selection-modify-around-input.html (445B)
1 <!doctype html> 2 <html> 3 <head> 4 <meta charset="utf-8"> 5 <style> 6 div { 7 border: medium solid red; 8 border-width: 32em; 9 } 10 </style> 11 <script> 12 document.addEventListener("DOMContentLoaded", () => { 13 document.execCommand("selectAll"); 14 getSelection().modify("move", "backward", "character"); 15 getSelection().collapseToStart(); 16 }, {once: true}); 17 </script> 18 </head> 19 <body> 20 <button contenteditable></button> 21 <input value="a"> 22 <div></div> 23 </body> 24 </html>