Tags
Today I got a requirement from my client that in tinyMCE editor I have to add few predefined content at cursor current position and after that cursor should remain on the same place instead of at the end of newly added content. So it is clear that to achieve that I have store the current cursor position in a variable before appending the new predefined content.
var ed = tinyMCE.get('TXT_AREA_ID'); // get editor instance var range = ed.selection.getRng().startOffset; // get range alert(range);