So I have a contenteditable button in my webpage I declare like so:
<button id="test" contentEditable="true">This <img src="image..png" /> is a button, click me!</button>
I move the caret around, and I want to find its final location. I tried both:
- window.getSelection().focusOffset.toString()
- document.getElementById('test').selectionStart.toString()";
but neither of them seems to work :( Any pointers?