<!DOCTYPE> | |
<html> | |
<body onload="test()"> | |
<select id="myList" size="10" multiple></select> | |
<script> | |
function populateList() | |
{ | |
var myList = document.getElementById("myList"); | |
var item; | |
for (var ii = 0; ii < 20; ii++) { | |
item = document.createElement("option"); | |
item.value = ii; | |
item.appendChild(document.createTextNode("Item #" + ii)); | |
myList.appendChild(item); | |
} | |
} | |
function test() | |
{ | |
populateList(); | |
} | |
</script> | |
</body> | |
</html> |