I have a prototype JS snippet here :-
if (document.selection) { // IE 8, 9, 10 var range = document.selection.createRange(); selectedText = range.text; selectionOK = this.highlightSelection(range); this.getOffset(); } else if (document.getSelection) { // IE 11 support see "http://msdn.microsoft.com/en-in/library/ie/ms535869(v=vs.85).aspx#properties" var range = document.getSelection().getRangeAt(0); selectedText = range.toString(); //selectedText = document.getSelection(); selectionOK = this.highlightSelection(range.createRange()); highlightSelection() is my custom function that accepts TxtRange and uses execCommand() to highlight the selected text. Now I am not able to convert range object to TxtRange and consequently, not able to highlight selected text in IE 11. how to get TxtRange in IE 11 ?
↧
How to highlight selected text in IE 11
↧