inserthorizontalrule-with-selecting-from-mphantom-to-end-of-line.html (545B)
1 <!doctype html> 2 <html><head> 3 <meta charset="utf-8"> 4 <script> 5 "use strict"; 6 7 document.addEventListener("DOMContentLoaded", () => { 8 const range = new Range(); 9 range.selectNodeContents(document.getElementById("mphantom")); 10 getSelection().addRange(range); 11 getSelection().modify("extend", "forward", "lineboundary"); 12 document.documentElement.contentEditable = true; 13 document.execCommand("insertHorizontalRule"); 14 }); 15 </script> 16 </head><body><math> 17 <mphantom id="mphantom"></mphantom>> 18 <munder></munder> 19 <!-- COMMENT --></math></body></html>