2 window
.onload
= () => {
3 // For emulating the traditional behavior, collapse Selection to end of the
4 // <body> (at the text node after the <input>).
5 getSelection().collapse(document
.body
, document
.body
.childNodes
.length
);
6 document
.execCommand("insertHorizontalRule");
7 getSelection().collapse(
8 document
.querySelector("b")
10 document
.execCommand("forwardDelete");
12 function onFocusChangeOfInput() {
13 document
.getSelection().setPosition(document
.querySelector("pre"));
17 <time contenteditable
>a|
</t>
18 <input onfocus=
"onFocusChangeOfInput()" autofocus
onblur=
"onFocusChangeOfInput()">