Is there a simple way of checking, whether the caret is at the very first, or last position in a contenteditable? I know that there are ways of getting the caret position, e.g., Get a range's start and end offset's relative to its parent container, but I was wondering, whether there is a simpler method, if I only want to know if the caret is at the top/bottom of the div.
What I try to do is to automatically move the caret to the previous/next div, if it has reached the top/bottom of the currently focused div. The HTML structure is simply
<div contenteditable=true id="div1">something here</div>
<div contenteditable=true id="div2">something else</div>
http://jsfiddle.net/v923z/92FWk/
Thanks,