i replace selected text with pasteHTML method (Pastes HTML text into the given text range, replacing any previous text and HTML elements in the range.) in internet explorer.
var ran = Editor.selection.createRange();
ran.pasteHTML('<span style="font-size:20px;">example</span>');
after replacing text, selection dissapears. how to highlight previous selection (text) again ? thanks
pasteHTMLwill delete the current selection from the document, so I assume you want to select the span you’ve replaced it with. To do this, add an ID to the span, move the TextRange to encompass its text and select it, as follows: