4 document
.addEventListener("DOMContentLoaded", () => {
5 // For emulating the traditional behavior, collapse Selection to end of the
6 // text node at end of the <body> (end of the text node after the <h3>).
7 getSelection().collapse(
8 document
.body
.lastChild
,
9 document
.body
.lastChild
.length
11 const textarea
= document
.querySelector("textarea");
12 const abbr
= document
.querySelector("abbr");
14 document
.addEventListener("DOMAttrModified", event
=> {
15 node
= event
.originalTarget
.getRootNode({});
16 abbr
.insertBefore(textarea
, abbr
.childNodes
[0]);
18 abbr
.contentEditable
= false;
20 document
.designMode
= "on";
21 document
.execCommand("insertParagraph");
30 <textarea autofocus
></textarea>