Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / forms / required-attribute-001.html
blobdf09920c7fae873f26060d77b5883924718e1885
1 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
2 <html>
3 <head>
4 <title>required attribute presence test</title>
5 <script src="../../resources/js-test.js"></script>
6 </head>
7 <body>
8 <p id="description"></p>
9 <div id="console"></div>
10 <input id="input" name="victim" required />
11 <textarea id="textarea" name="victim" required></textarea>
12 <select id="select" name="victim" required>
13 <option value="" selected />
14 <option value="X">X</option>
15 </select>
16 <script language="JavaScript" type="text/javascript">
17 function requiredFor(id) {
18 return document.getElementById(id).required;
21 description("There are three form control elements below, all required.");
23 v = document.getElementsByName("victim");
25 shouldBeTrue('requiredFor("input")');
26 shouldBeTrue('requiredFor("textarea")');
27 shouldBeTrue('requiredFor("select")');
28 </script>
29 </body>
30 </html>