<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title></title>
<script src="js/jquery-1.6.2.min.js" type="text/javascript"></script>
<script language="javascript" type="text/javascript">
/*
节点遍历(jQuery所有元素的方法会隐式迭代)
.next() 方法用于获取节点之后的挨着的第一个同辈元素;
.nextAll() 方法用于获取节点之后的的所有同辈元素;
.siblings() 方法用于获取全部的同胞(兄弟)元素,
原始元素不包含在同胞元素中,当我们打算找到 DOM 树的特定层级上的所有元素时,记住一点很重要。
*/
$(function() {
// $("div").click(function() { alert($(this).next().text()); });
// $("div").click(function() { alert($(this).nextAll().text()); });
$("div").click(function() { $(this).siblings().css('background', 'red'); })
});
</script>
</head>
<body>
<form id="form1" runat="server">
<div>11</div>
<div>22</div>
<div>33</div>
<div>44</div>
<div>55</div>
<div>55</div>
</form>
</body>
</html>