javascript - Check what item is next to be deleted with delete key press -
I am working with a content editable area (especially in chrome)
If I capture the deleted key press, is it possible to know what the next element or text is to be removed?
What I really want to test is to remove the next item
& lt; Div class = "clearfix" & gt; & Lt; / Div & gt; Then I do not want to delete it.
I was looking at Tracy selection here: but it was not really clear how to implement it, what should I also see.
Do not ignore friends. It was a dumb question. It is just so necessary that if I am the current node I am finally, so I can not do anything
Sometimes I make things more complicated that are actually in reality.
Something worked for me:
if (event.keyCode == 46) {var s = document.getSelection (); If (S. Charoffset == s.anchorNode.length) {return false; }}
Comments
Post a Comment