get-input-selection

getInputSelection() provides carrot position for textarea. Works as selectionBegin and selectionEnd for all browsers

Usage no npm install needed!

<script type="module">
  import getInputSelection from 'https://cdn.skypack.dev/get-input-selection';
</script>