<script>
window.onload = () => {
a.addEventListener("DOMNodeRemoved", () => {
document.getSelection().collapse(document.getElementById(""))
})
document.execCommand("delete", false)
}
</script>
<div id="a" contenteditable>x</link>