2 window
.onload
= () => {
3 document
.execCommand("undo");
6 // For emulating the traditional behavior, collapse Selection to end of the
7 // text node at end of the <details> (<p> is closed before the <details>).
8 const details
= document
.querySelector("details");
9 getSelection().collapse(details
.lastChild
, details
.lastChild
.length
);
10 const link
= document
.querySelector("link");
11 document
.execCommand("delete");
12 document
.querySelector("iframe").contentDocument
.adoptNode(link
);
17 <details open
ontoggle=
"onToggle()">