Having some trouble with the behavior of a contenteditable div. The code structure is like this:
<div contenteditable="true">
<p id="element-id-1">element-id-1</p>
<p id="element-id-2">element-id-2</p>
</div>
Everything works fine except when I triple click the first paragraph to remove it, the second paragraph jumps up and retains the ID of the deleted paragraph. Is there a way to prevent this? I want the second paragraph to keep its original ID (#element-id-2) even after deleting the first one. See the JSFiddle demonstration here. Thank you!