1345015.html (747B)
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <script type="application/javascript"> 5 document.designMode = "on"; 6 let selection = window.getSelection(); 7 8 let foo = document.createElement('foo'); 9 let div = document.createElement('div'); 10 document.documentElement.appendChild(foo); 11 document.documentElement.appendChild(div); 12 foo.outerHTML = '<foo>'; 13 14 let range = document.createRange(); 15 range.selectNode(div); 16 selection.addRange(range); 17 range.setStart(foo, 0); 18 19 range = document.createRange(); 20 range.selectNode(document.documentElement); 21 selection.addRange(range); 22 23 document.execCommand('insertparagraph', false, null); 24 </script> 25 </head> 26 <body> 27 </body> 28 </html>