var th4 = document.getElementById("ctl00_ContentPlaceHolder1_thirdFieldSelect");
var th5 = document.getElementById("ctl00_ContentPlaceHolder1_mySelectedItem");
function selectOtherListboxItem()
{
for (i=th4.childNodes.length - 1; i>=0;i--)
{
if (th4.childNodes[i].nodeType == 1)
{
if (th4.childNodes[i].selected == true)
{
if(th5.childNodes[i].nodeType == 1)
{
th5.childNodes[i].selected == true;
}
}
}
}
} 上述代码无法实现,但不报错。
<select id="s1">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<select id="s2">
<option value="0">0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
</select>
<script>
var s1 = document.getElementById('s1'), s2 = document.getElementById('s2');
s1.onchange = function(){
s2.options[this.selectedIndex].selected=true;
}
</script>
还提示undefined,真是郁闷
看了一下, listbox 是什么东西?? Asp的??