If I type a, and then <enter>into the IE11 text area and the log selectionStart, it 2(this is what I would expect). However, if I put the textarea value programmatically on 'a\n', it selectionStartwill be instead 4.
$('textarea').val('a\n');
console.log($('textarea').get(0).selectionStart);
Anyway, to get the exact cursor position here?
source
share