Answers for "jquery get cursor position"

0

jquery get cursor position

Use selectionStart, it is compatible with all major browsers.

document.getElementById('foobar').addEventListener('keyup', e => {
  console.log('Caret at: ', e.target.selectionStart)
})
<input id="foobar" />
Posted by: Guest on March-02-2021

Code answers related to "jquery get cursor position"

Code answers related to "Javascript"

Browse Popular Code Answers by Language