I have a contenteditable div which contains typical wysiwyg editor html (bold, anchors, lists).
I need to determine if the current cursor is, onKeyDown, at the start
Simple solution for checking if cursor/caret is at the end of an input:
this.$('input').addEventListener('keydown', (e) => { if (e.target.selectionEnd == e.target.value.length) { // DO SOMETHING } })