6 testRunner
.dumpAsText();
7 var select
= document
.getElementById('select');
8 var index
= select
.selectedIndex
;
9 document
.forms
[0].reset();
10 var message
= "selected index is " + index
+ " before and " + select
.selectedIndex
+ " after reset().";
11 var paragraph
= document
.createElement('p');
12 paragraph
.appendChild(document
.createTextNode(message
));
13 document
.getElementById('console').appendChild(paragraph
);
17 <body onload=
"test();">
18 <p>This tests reseting of a select box with no selected options using JavaScript. If successful, both times the selected index should be
0.
<form>
21 <option>Option
0</option>
22 <option>Option
1</option>
23 <option>Option
2</option>