Imagine having a contenteditable area with some existing content:
<div contenteditable="true">
<p>first paragraph</p>
<p>
<img width='63' src='https://developer.cdn.mozilla.net/media/img/mdn-logo-sm.png'>
<img width='63' src='https://developer.cdn.mozilla.net/media/img/mdn-logo-sm.png'>
</p>
<p>second paragraph</p>
</div>
If you try to navigate using the left/right arrow keys, the caret will move through all child elements. Check out this gif animation
The question is: how can you make the caret ignore child elements? Or in other words, how can you treat the two images inside as a single image? jsfiddle