1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <script type='text/javascript'>
function populate(){
for (i=0;i<200;i++){
var monselect =document.getElementsByTagName('select')[0]
var newoption=document.createElement('option');
newoption.value="i"
newoption.innerHTML="option "+i;
//monselect.options.length=i
monselect.appendChild(newoption)
}
setTimeout(function(){monselect.selectedIndex=50},100)
//alert(monselect.options.length)
}
</script>
</head>
<body onload='populate()'>
<select >
</select>
</body>
</html> |
Partager