2 * { position: absolute; }
6 // For emulating the traditional behavior, collapse Selection to end of the
7 // text node in the <iframe> which is the last child of the <body>. Note that
8 // <iframe> is treated as a container in HTMLEditor.
9 const iframe
= document
.querySelector("iframe");
10 getSelection().collapse(iframe
.firstChild
, iframe
.firstChild
.length
);
11 document
.querySelector("del").addEventListener("DOMSubtreeModified", () => {
12 document
.execCommand("italic");
13 document
.execCommand("selectAll");
15 const anchor
= document
.querySelector("a[contenteditable]");
16 anchor
.replaceChild(iframe
, anchor
.childNodes
[0]);
19 <body onload=
"onLoad()">