在IE中可以获得的length,但在Firefox却不能?
单击“获得”按钮,在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>
...全文
相关推荐
兼容Firefox和IE的onpropertychange事件oninput
在IE中使用`onpropertychange`,在非IE浏览器(如Firefox)中使用`oninput`。
让innerText在firefox火狐和IE浏览器都能用的写法
如果不是IE(即为Firefox或其他非IE浏览器),则进行以下操作:1. 定义`innerText`的getter方法,遍历元素的所有子节点,根据节点类型(`nodeType`)决定如何处理。
IE浏览器兼容Firefox的JS脚本的代码
Length Required)。
Firefox和IE浏览器兼容JS脚本写法小结
这是在创建跨浏览器的Ajax请求时需要注意的一个细节,以避免出现411错误(Length Required)。
Firefox和IE兼容性问题及解决方法总结
"Firefox与IE浏览器兼容性问题及解决方案"在构建多语言Java网站时,开发者经常遇到一个挑战:代码在Firefox上运行良好,但在Internet Explorer(IE)上却出现问题,


