input-stoppropagation.html (524B)
1 <!doctype html> 2 <html> 3 <script src="/tests/SimpleTest/EventUtils.js"></script> 4 <script> 5 function onLoad() { 6 let input2 = document.getElementById("input2"); 7 input2.addEventListener("focus", e => { 8 e.stopImmediatePropagation(); 9 }); 10 document.getElementById("input1").focus(); 11 synthesizeKey("KEY_Tab"); 12 synthesizeKey("KEY_Tab", {shiftKey: true}); 13 synthesizeKey("KEY_Tab"); 14 } 15 </script> 16 <body onload="onLoad()"> 17 <input type="text" id="input1"></input> 18 <input type="text" id="input2"></input> 19 </body> 20 </html>