<!-- This test was derived from a real case inside the Mail application, bug 4598149--> | |
<div id="mydiv">01234</div> | |
<script> | |
var txt = document.getElementById("mydiv").firstChild; | |
window.getSelection().setBaseAndExtent(txt, 0, txt, 5) | |
var r = window.getSelection().getRangeAt(0); | |
r.deleteContents(); | |
r.insertNode(document.createElement("div")); | |
</script> |