inputwillvalidate.html (1048B)
1 <!DOCTYPE html> 2 <html><head> 3 <title>willValidate property on the input element</title> 4 <meta content="text/html; charset=UTF-8" http-equiv="content-type"> 5 <meta content="willValidate property on the input element" name="description"> 6 <link href="https://html.spec.whatwg.org/multipage/#dom-cva-willvalidate" rel="help"> 7 </head> 8 <body> 9 <script src="/resources/testharness.js"></script> 10 <script src="/resources/testharnessreport.js"></script> 11 12 <div id="log"></div> 13 14 <form action="http://www.example.com/" style="display : none"> 15 <input required="" type="text"> 16 <input disabled="" type="text"> 17 </form> 18 19 <script type="text/javascript"> 20 21 test(function() {assert_true(document.getElementsByTagName("input")[0].willValidate)}, "willValidate property returns true when required attribute exists"); 22 test(function() {assert_false(document.getElementsByTagName("input")[1].willValidate)}, "willValidate property returns false when disabled attribute exists"); 23 24 </script> 25 26 </body></html>