3 const data
= document
.querySelector("data");
4 const source
= document
.querySelector("source");
5 // For emulating the traditional behavior, collapse Selection to end of the
6 // <data> which is the deepest last child (and a container) of the <body>.
7 getSelection().collapse(data
, data
.childNodes
.length
);
9 document
.body
.firstChild
// The invisible text node
11 getSelection().setBaseAndExtent(
12 data
.appendChild(source
),
17 document
.querySelector("audio")
18 .addEventListener("DOMCharacterDataModified", () => {
19 getSelection().removeAllRanges()
21 document
.execCommand("delete");
24 <body onload=
"onLoad()">