本文共 484 字,大约阅读时间需要 1 分钟。
1. children()方法:
该方法用于取得匹配元素的子元素集合。
Insert title here
2. next()方法:
该方法用于取得匹配元素后面紧邻的同辈元素。
Insert title here
3. prev()方法:
该方法用于取得匹配元素前面紧邻的同辈元素。
Insert title here 我是一个段落
4. siblings()方法:
该方法用于取得匹配元素前后所有的同辈元素。
访问这个页面:Insert title here 我是第一段
我是第二段
我是第三段
单击按钮后页面变为:
除此之外,jQuery还有很多遍历节点的方法,例如closest(),find(),filter(),nextAll(),prevAll(),parent()和parents()等。