event-select-manual.html (1100B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>HTMLInputElement Test: select event</title> 4 <link rel="author" title="Intel" href="www.intel.com/"> 5 <meta name="flags" content="interact"> 6 <link rel="help" href="https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#dom-textarea/input-select"> 7 <script src="/resources/testharness.js"></script> 8 <script src="/resources/testharnessreport.js"></script> 9 10 <form id="testForm" name="testForm"> 11 <input id="testInput" type="text" value="0123456789"/> 12 </form> 13 14 <h2>Description</h2> 15 <p> 16 This test validates that select characters in input element should fired select event. 17 </p> 18 19 <h2>Test steps:</h2> 20 <ol> 21 <li> 22 Select any numeric characters in the input flag below 23 </li> 24 </ol> 25 26 <script> 27 28 let input = document.getElementById("testInput"); 29 30 setup({explicit_done : true, explicit_timeout : true}); 31 32 on_event(input, "select", evt => { 33 test(() => { 34 assert_greater_than(input.value.substring(input.selectionStart, input.selectionEnd).length, 0, "Check if the select event captured when text selected"); 35 }); 36 done(); 37 }); 38 39 </script>