jquery IE下取值正常,FF下取不到
想取得所有选择了的VALUE值为111的SELECT控件的数量,下面的代码在IE下length能取得,但FF下取不到
<html>
<head>
<script type="text/javascript" src="/jquery/jquery.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$("button").click(function(){
alert($("option[selected][value='111']").length);
});
});
</script>
</head>
<body>
<select name="select1">
<option value="aaa">AAA</option>
<option value="bbb">BBB</option>
<option value="ccc">CCC</option>
</select>
<select name="select2">
<option value="111">AAA</option>
<option value="222">BBB</option>
<option value="333">CCC</option>
</select>
<button type="button">Click me</button>
</body>
</html>
------解决方案--------------------
alert($(":selected[value='111']").length);