<script>
function getsel()
{
for(i=0;i<document.all.mysel.options.length;i++)
{
ifsel=document.all.mysel.options[i].selected?"被选中了":"未被选中";
alert("第"+(i+1)+"个值为"+document.all.mysel.options[i].value+","+ifsel);
}
}
</script>
<select name=mysel size=5 multiple>
<option value=1>1
<option value=2>2
<option value=3>3
<option value=4>4
<option value=5>5
</select>
<input type=button value=get onclick=getsel()>
function getsel()
{
for(i=0;i<document.all.mysel.options.length;i++)
{
ifsel=document.all.mysel.options[i].selected?"被选中了":"未被选中";
alert("第"+(i+1)+"个值为"+document.all.mysel.options[i].value+","+ifsel);
}
}
</script>
<select name=mysel size=5 multiple>
<option value=1>1
<option value=2>2
<option value=3>3
<option value=4>4
<option value=5>5
</select>
<input type=button value=get onclick=getsel()>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货