1

I've spent quite some time trying and searching but could not find a IE11 compatible version of this legacy code:

setCaretPosition: function (len, iCaretPos) {
    var oSel = top.document.selection.createRange();
    oSel.moveEnd('character', -len);
    oSel.moveStart('character', iCaretPos);
    oSel.moveEnd('character', 0);
    oSel.select();
},

It's actually just setting the caret position. I've read that document.selection is no longer supported in IE11 and that document.getSelection() was the alternative. I've also seen this great resource. However, I could not manage to get the moveEnd or moveStart methods working with document.getSelection().

Does anybody know a working IE11 equivalent?

peter
  • 2,103
  • 7
  • 25
  • 51

0 Answers0