1655508.html (899B)
1 <html> 2 <head> 3 <script> 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 10 ); 11 const textarea = document.querySelector("textarea"); 12 const abbr = document.querySelector("abbr"); 13 let node; 14 document.addEventListener("DOMAttrModified", event => { 15 node = event.originalTarget.getRootNode({}); 16 abbr.insertBefore(textarea, abbr.childNodes[0]); 17 }, false); 18 abbr.contentEditable = false; 19 node.normalize(); 20 document.designMode = "on"; 21 document.execCommand("insertParagraph"); 22 }); 23 </script> 24 </head> 25 <body> 26 <dfn contenteditable> 27 <abbr></abbr> 28 </dfn> 29 <h3> 30 <textarea autofocus></textarea> 31 <script></script> 32 </h3> 33 </body> 34 </html>