我们用select的onchange事件时,常会遇到这样一个问题,那就是连续选相同一项时,不触发onchange事件.select的onchange事件就是这样子的.你得有change(改变),才能触发该事件....
掌握了它的特性后,相应的解决办法也很简单.
<select name=sel onchange="bao(this.options[this.options.selectedindex].value)">
<option value="">请选择
<option value="1">item 1
<option value="2">item 2
<option value="3">item 3
</select>
<script>
function bao(s)
{
txt.value+=s;
//选择后,让第一项被选中,这样,就有change啦.
document.all.sel.options[0].selected=true;
}
</script>
<textarea id=txt></textarea>