зеркало из https://github.com/mozilla/gecko-dev.git
12 строки
528 B
HTML
12 строки
528 B
HTML
<div contenteditable> a</div>
|
|
<script>
|
|
// For emulating the traditional behavior, collapse Selection to end of the
|
|
// text node in this <script>.
|
|
const script = document.querySelector("script");
|
|
getSelection().collapse(script.lastChild, script.lastChild.length);
|
|
const editingHost = document.querySelector("div[contenteditable]");
|
|
editingHost.insertBefore(document.createTextNode(""), editingHost.firstChild);
|
|
getSelection().collapse(editingHost.firstChild.nextSibling, 2);
|
|
document.execCommand("delete");
|
|
</script></body>
|