input-width.html (827B)
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_width</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 name="input_form"> 21 <p><input type='image' id='input_text'></p> 22 </form> 23 24 <script> 25 26 var input_text = document.getElementById("input_text"); 27 input_text.width = 30; 28 29 if (typeof(input_text.width) == "number") { 30 test(function() { 31 assert_equals(input_text.width, 30, "width attribute is not correct."); 32 }); 33 } else { 34 test(function() { 35 assert_unreached("width attribute is not exist."); 36 }); 37 } 38 39 </script> 40 41 </body> 42 </html>