blob: 9c46a5639ef0f6a1f022a5841dde80b9f7e5e013 [file] [log] [blame]
<head>
<script>
function test()
{
if (window.testRunner)
testRunner.dumpAsText();
var select = document.getElementById('select');
var index = select.selectedIndex;
document.forms[0].reset();
var message = "selected index is " + index + " before and " + select.selectedIndex + " after reset().";
var paragraph = document.createElement('p');
paragraph.appendChild(document.createTextNode(message));
document.getElementById('console').appendChild(paragraph);
}
</script>
</head>
<body onload="test();">
<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>
<form>
<select id="select">
<option>Option 0</option>
<option>Option 1</option>
<option>Option 2</option>
</select>
</form>
<p id="console"></p>
</body>