How to prevent the cursor to go back while pressing backspace key in
javascript?
Please consider the following html.
<div id="container" contenteditable="true">
<p>This is a paragraph <span class="test">'this text is inside the
span'</span>
This is another paragraph afer the span tag inside this p tag
</p> </div>
As you see, the p and the span tag are editable in the browser.It means we
can write in it in browser. Now my question is about the span inside the p
tag. So can anyone explain If the cursor (while typing in this span in
browser) is just after the span tag i.e after the closing span tag,the
backspace key should not work.
More simple,once the cursor goes outside the span,the backspace key should
not move it again to go to the span. Please help with a simple example in
javascript.
Thanks to all.
No comments:
Post a Comment