Tuesday, June 4, 2024
 Popular · Latest · Hot · Upcoming
92
rated 0 times [  96] [ 4]  / answers: 1 / hits: 18401  / 11 Years ago, thu, november 7, 2013, 12:00:00

For some reason, I need to execute :



tinyMCE.activeEditor.setContent(text, {format : 'html'});


After that, how to put the cursor to the end of the text ?


More From » jquery

 Answers
43
ed.selection.select(ed.getBody(), true); // ed is the editor instance
ed.selection.collapse(false);


This seems to be answered by Peter Wooster in thread jQuery Set Cursor Position in Text Area



EDIT For TINYMCE use:



tinyMCE.activeEditor.selection.select(tinyMCE.activeEditor.getBody(), true);
tinyMCE.activeEditor.selection.collapse(false);

[#74444] Wednesday, November 6, 2013, 11 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
diontajm

Total Points: 391
Total Questions: 104
Total Answers: 104

Location: Netherlands
Member since Mon, Jun 7, 2021
3 Years ago
;