I have a div that has contenteditable set to true and then two more div's inside being added dynamically. For example
<div contenteditable='true'>
<div id='1'>
<span>Something Editable</span>
<span contenteditable='false'>Something NOT Editable</span>
</div>
<div id='2'>
<span>Second Something Editable</span>
<span contenteditable='false'>Something NOT Editable</span>
</div>
</div>
If I have my cursor in the span that says Second Something Editable, and I press backspace, it moves the text in this span to the first div, like the code below, which I do not want.
<div contenteditable='true'>
<div id='1'>
<span>Something Editable</span>
<span contenteditable='false'>Something NOT Editable</span>
Second Something Editable.
</div>
<div id='2'>
<span contenteditable='false'>Something NOT Editable</span>
</div>
</div>
And again, if I press enter in the First div (div id=1) on the line that says Second Something Editable, it would create a new div with id=1 and put the content there. Can anyone tell me how to fix this. Thanks