在IE中可以获得的length,但在Firefox却不能?

亚细亚 亚细亚 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
单击“获得”按钮,在IE中显示为3,但是在Firefox中却没有反应,这是什么原因?

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<script language="javascript">
function getLength()
{
seletLen=document.getElementById("selectInfo").length
alert(seletLen);
}

</script>
<body>
<div id="outer">

<select name="selectInfo" size="20" style="width:200px;" multiple="multiple" >
<option value="">aaa</option>
<option value="">bbb</option>
<option value="">ccc</option>
</select>

</div>
<input type="button" value="获得" onClick="getLength()">
</body>
</html>

...全文
评论 5
收藏 已收藏
分享
返回顶部
亚细亚
JavaScript 87,984 成员 224,681 内容