1408170.html (932B)
1 <script> 2 function onLoad() { 3 try { 4 document.execCommand("insertUnorderedList"); 5 } catch(e) {} 6 try { 7 document.execCommand("delete"); 8 } catch(e) {} 9 } 10 11 function onToggle1() { 12 try { 13 getSelection().collapse( 14 document.querySelector("font"), 15 1 16 ); 17 } catch(e) {} 18 } 19 20 function onToggle2() { 21 // For emulating the traditional behavior, collapse Selection to end of the 22 // text node in the <summary> which is the last child of the <body>. 23 const summary = document.querySelector("summary"); 24 getSelection().collapse(summary.firstChild, summary.firstChild.length); 25 try { 26 document.querySelector("label").appendChild( 27 document.querySelector("font") 28 ); 29 } catch(e) {} 30 } 31 </script> 32 <body onload="onLoad()"> 33 <label contenteditable> 34 <details ontoggle="onToggle2()" open> 35 </details> 36 </label> 37 <details ontoggle="onToggle1()" open> 38 <font dir="rtl"> 39 <summary> 40 </details></font></summary></body>