3 <script src=
"../../resources/js-test.js"></script>
5 window
.jsTestIsAsync
= true;
7 var form
= document
.getElementById('form');
8 var field
= document
.getElementById('field');
10 shouldBeTrue("('autocomplete' in form)");
11 shouldBeTrue("('autocomplete' in field)");
13 shouldBeNull("form.getAttribute('autocomplete')");
14 shouldBeNull("field.getAttribute('autocomplete')");
16 shouldBeEqualToString("form.autocomplete", "on");
17 shouldBeEqualToString("field.autocomplete", "");
19 shouldBeEqualToString("form.autocomplete = 'off'; form.getAttribute('autocomplete')", "off");
20 shouldBeEqualToString("field.autocomplete = 'off'; field.getAttribute('autocomplete')", "off");
21 shouldBeEqualToString("form.setAttribute('autocomplete', 'on'); form.autocomplete", "on");
22 shouldBeEqualToString("field.setAttribute('autocomplete', 'on'); field.autocomplete", "on");
23 shouldBeEqualToString("form.setAttribute('autocomplete', 'indeterminate'); form.autocomplete", "on");
24 shouldBeEqualToString("field.setAttribute('autocomplete', 'indeterminate'); field.autocomplete", "indeterminate");
29 <body onload=
"test()">
30 This tests that the 'autocomplete' attribute of form and input elements is bound to a JavaScript property.
32 <input type=
"text" id=
"field" />
34 <div id=
"console"></div>