<!DOCTYPE html> | |
<html> | |
<script> | |
function test() { | |
sel = document.getElementById("sel"); | |
sel.selectedIndex = 49; | |
sel.selectedIndex = -1; | |
} | |
</script> | |
<body onload="test()"> | |
<select multiple id="sel" style="width:500px; height:300px;"></select> | |
<script> | |
sel = document.getElementById("sel"); | |
for (var i = 0; i < 50; i++) { | |
option = document.createElement("option"); | |
option.innerHTML = "Option " + i; | |
sel.appendChild(option); | |
} | |
</script> | |
</body> | |
</html> |