| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <title>required attribute presence test</title> |
| <script src="../../resources/js-test-pre.js"></script> |
| </head> |
| <body> |
| <p id="description"></p> |
| <div id="console"></div> |
| <input id="input" name="victim" required /> |
| <textarea id="textarea" name="victim" required></textarea> |
| <select id="select" name="victim" required> |
| <option value="" selected /> |
| <option value="X">X</option> |
| </select> |
| <script language="JavaScript" type="text/javascript"> |
| function requiredFor(id) { |
| return document.getElementById(id).required; |
| } |
| |
| description("There are three form control elements below, all required."); |
| |
| v = document.getElementsByName("victim"); |
| |
| shouldBeTrue('requiredFor("input")'); |
| shouldBeTrue('requiredFor("textarea")'); |
| shouldBeTrue('requiredFor("select")'); |
| </script> |
| <script src="../../resources/js-test-post.js"></script> |
| </body> |
| </html> |