3 Purpose: To test if the both DOM1 and DOM2 versions of the add() method add an option to a dropdown list. You should see three
"TEST PASSED" lines below.
6 <select name=
"my_select">
7 <option value=
"a">a
</option>
12 if (window
.testRunner
)
13 testRunner
.dumpAsText();
16 document
.my_form
.my_select
.add(new Option("c", "c"));
17 if (document
.my_form
.my_select
.options
[1].value
== 'c')
19 document
.write("DOM1 TEST PASSED");
22 document
.write("DOM1 TEST FAILED");
24 document
.write('<br>');
27 document
.my_form
.my_select
.add(new Option("b", "b"), document
.my_form
.my_select
.options
[1]);
28 if (document
.my_form
.my_select
.options
[1].value
== 'b')
30 document
.write("DOM2 full TEST PASSED");
33 document
.write("DOM2 full TEST FAILED");
35 document
.write('<br>');
37 document
.my_form
.my_select
.add(new Option("d", "d"), null);
38 if (document
.my_form
.my_select
.options
[3].value
== 'd')
40 document
.write("DOM2 null TEST PASSED");
43 document
.write("DOM2 null TEST FAILED");