LMSouq
moodle-core Open

How to alert the selected text from the tinyMCE editor?

SA
Santhucool
1 month ago
3 views
Problem Description
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**

AI-Generated Solution

Powered by LMSouq AI · GPT-4.1-mini

✓ Solution Ready
Analyzing problem and generating solution…
Was this solution helpful?
Back to Knowledge Base