为什么firebug总是提醒undefined。。。。明明都定义过了。。很简单的代码求大神看看~
<html><head>
<title>Options</title>
</head>
<script>
var ProvinceList=document.getElementById('MyProvince');
if(ProvinceList)
{
var nIndex=ProvinceList.selectedIndex;
}
else
{
alert('No Pro');
}
</script>
<form name='MyForm'>
<p>Provinces:
<select name='MyProvince' id='MyProvince'>
<option value="chooseProvince" selected='selected'>--choose--</option>
<option value='HuBeiProvince'>HuBei</option>
<option value='HuNanProvince'>HuNan</option>
</select>
</p>
</form>
</center>
</body>
</html>