3 // For emulating the traditional behavior, collapse Selection to end of the
4 // text node which is the last child of the <dd contenteditable> which is the
5 // last child of the <body>.
6 const dd
= document
.querySelector("dd[contenteditable]");
7 getSelection().collapse(dd
.lastChild
, dd
.lastChild
.length
);
8 document
.execCommand("justifyFull");
9 document
.execCommand("selectAll");
10 window
.top
.addEventListener("DOMNodeRemoved", () => {
11 document
.execCommand("insertHTML", false, undefined)
13 document
.execCommand("heading", false, "H1")
16 <body onload=
"onLoad()">