README
jQuery Caret
- get the caret's position:
pos = $(textarea).caret()
- set the caret's position:
$(textarea).caret(pos)
- set the caret's position to the end:
$(textarea).caret(-1)
Return value: the current/new caret position
Manipulate the caret's position in a text box or content-editable element
<script type="module">
import accursoftJqueryCaret from 'https://cdn.skypack.dev/@accursoft/jquery-caret';
</script>
pos = $(textarea).caret()
$(textarea).caret(pos)
$(textarea).caret(-1)
Return value: the current/new caret position