In a contenteditable div, when I select a sentence with inside a element with listeners and I move the sentence elsewhere, I lose these listeners.
Do you know why ?
https://jsfiddle.net/er069bsj/
<div contenteditable=true>
If you move by selection this sentence "LOREM <span id="1" class="element" onmouseover="console.log('mouseover word 1');this.style.backgroundColor='yellow'" onmouseout="console.log('mouseout word 1');this.style.backgroundColor='red'">WORD 1</span>FINIBUS", you lose the listener.<br> Other example with this sentence "NNULLAM <span id="2" class="element" onmouseout="console.log('mouseout word 2');this.style.backgroundColor='red'">WORD 2</span>METUS".
You can for example move the sentence LOREM WORD 1 FINIBUS in my Fiddle example and you can see mouseover and mouseout don't work after the move.