<script>
function check(obj)
{
for(i=0;i<document.all.mysel.options.length;i++)
if(obj.value==document.all.mysel.options[i].text)
{document.all.mysel.options[i].selected=true;
return;
}
document.all.mysel.options.length++;
document.all.mysel.options[i].text=obj.value;
document.all.mysel.options[i].selected=true;
}
</script>
<select name=mysel>
<option>1
<option>2
<option>3
</select>
<input name=myval>
<input type=button onclick=check(document.all.myval)>
function check(obj)
{
for(i=0;i<document.all.mysel.options.length;i++)
if(obj.value==document.all.mysel.options[i].text)
{document.all.mysel.options[i].selected=true;
return;
}
document.all.mysel.options.length++;
document.all.mysel.options[i].text=obj.value;
document.all.mysel.options[i].selected=true;
}
</script>
<select name=mysel>
<option>1
<option>2
<option>3
</select>
<input name=myval>
<input type=button onclick=check(document.all.myval)>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货