![javascript - how to get the caret position of a contenteditable div which contains images - Stack Overflow javascript - how to get the caret position of a contenteditable div which contains images - Stack Overflow](https://i.stack.imgur.com/2SydY.png)
javascript - how to get the caret position of a contenteditable div which contains images - Stack Overflow
Minko Gechev on Twitter: "Tip: in JavaScript you can an get element by a position relative to the viewport No need for heavy computations trying to match the cursor position to the
How to Set the Cursor Position on contentEditable Div with JavaScript? | by John Au-Yeung | Dev Genius
![How To Find The Caret Inside A Contenteditable Element | by Konstantin Münster | JavaScript in Plain English How To Find The Caret Inside A Contenteditable Element | by Konstantin Münster | JavaScript in Plain English](https://miro.medium.com/max/1200/1*UtM9VEBCuDq4aC2spcZtTA.png)