How to alert the selected text from the tinyMCE editor . I already created a plugin for Moodle tinyMCE. When I click the plugin button in tinyMCE a popup will display. In that popup I want to display the selected text. This is my requirement. For this i want to get the selected text from editor.
What I tried:
alert(tinyMCEPopup.editor.selection.getContent({format : 'text'}));
Nothing is happened
alert(tinyMCEPopup.editor.getContent({format : 'text'}));
The above code alerts the entire text in editor.
I can't get the selected text.I only need the selected text.
I am using Moodle 2.7