1623166.html (607B)
1 <html> 2 <head> 3 <script> 4 document.addEventListener('DOMContentLoaded', () => { 5 const code = document.querySelector("code[contenteditable=false]"); 6 // For emulating the traditional behavior, collapse Selection to end of the 7 // last text node in the <code> which is the last inline container of the 8 // <body>. 9 getSelection().collapse(code.lastChild, code.lastChild.length); 10 code.querySelector("br").contentEditable = true; 11 document.execCommand("indent"); 12 }); 13 </script> 14 <body> 15 <b contenteditable hidden> 16 <script></script> 17 <code contenteditable="false"> 18 <br> 19 </body> 20 </head> 21 </html>