| <!DOCTYPE HTML> |
| <html> |
| <head> |
| <title>Forms</title> |
| <script src="../../resources/testharness.js"></script> |
| <script src="../../resources/testharnessreport.js"></script> |
| </head> |
| <body> |
| <p> |
| <h3>input_labels</h3> |
| </p> |
| |
| <hr> |
| |
| <div id="log"></div> |
| |
| <form method="post" |
| enctype="application/x-www-form-urlencoded" |
| action="" |
| id="input_form"> |
| <p><label>Full name:<label>(name)<input name=fn id='input_text1'> <small>Format: First Last</small></label></label></p> |
| <p><label>Age: <input name=age type=number min=0 id='input_text2'></label></p> |
| <p><label>Post code: <input name=pc> <small>Format: AB12 3CD</small></label></p> |
| </form> |
| <script> |
| |
| var input1 = document.getElementById("input_text1"); |
| var input2 = document.getElementById("input_text2"); |
| |
| if (typeof(input1.labels) == "object") { |
| if (input1.labels.length == 2 && input2.labels.length == 1) { |
| test(function() { |
| assert_true(true, "labels attribute is correct."); |
| }); |
| } else { |
| test(function() { |
| assert_unreached("labels attribute is not correct."); |
| }); |
| } |
| } else { |
| test(function() { |
| assert_unreached("labels attribute is not exist."); |
| }); |
| } |
| |
| </script> |
| |
| </body> |
| </html> |