input-checkvalidity.html (805B)
1 <!DOCTYPE HTML> 2 <html> 3 <head> 4 <title>Forms</title> 5 <script src="/resources/testharness.js"></script> 6 <script src="/resources/testharnessreport.js"></script> 7 </head> 8 <body> 9 <p> 10 <h3>input_checkValidity</h3> 11 </p> 12 13 <hr> 14 15 <div id="log"></div> 16 17 <form method="post" 18 enctype="application/x-www-form-urlencoded" 19 action="" 20 id="input_form"> 21 <p><input type='hidden' id='input_text'></p> 22 </form> 23 <script> 24 25 var input = document.getElementById("input_text"); 26 27 try 28 { 29 var ret = input.checkValidity(); 30 31 test(function() { 32 assert_equals(ret, true, "calling of checkValidity method is failed."); 33 }); 34 } 35 catch (e) { 36 test(function() { 37 assert_unreached("Error is raised."); 38 }); 39 } 40 41 </script> 42 43 </body> 44 </html>