Placing Caret Outside Of Inserted Tag In Contenteditable
I am inserting a span tag into a contentEditable div using the document.execCommand insertHTML method. After the insertion, i want the caret to be set at the end of the input, so t
Solution 1:
Terrible hack that i have come up with is to insert another span element immediately afterword:
document.execCommand('insertHTML', false, '<span> </span>');
Now the new content goes into this span element instead. Hopefully there is a better solution.
Post a Comment for "Placing Caret Outside Of Inserted Tag In Contenteditable"