我使用了最新的jQuery版本(1.9.1)空標記元素和:可見?
我有一個空span
元素:
<!DOCTYPE html>
<html>
<head>
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<meta charset=utf-8 />
<title>JS Bin</title>
</head>
<body> <span class="c"></span>
</body>
<script type='text/javascript'>
alert($(".c:visible").length);
</script>
</html>
- Chrome瀏覽器(最新版)提醒
0
- FF(最新版本)警報
1
- IE(8)警報
0
爲什麼不在Chrome中提示1
?元素不隱藏。
我可以解決此通過使用過濾器和吐出所有的!display:none
,但想知道如果我做錯什麼
http://jsbin.com/urihov/2/edit
在FF和Safari它提醒0 – 2013-03-19 07:10:09
@SubodhGhulaxe mmm..not到我的測試中.... HTTP://i.stack.imgur.com/ fvl3j.jpg(18.02) – 2013-03-19 07:10:57
FF 19.0.2 - 顯示「0」 – inser 2013-03-19 07:13:27