jQuery element ~ siblings 选择器
jQuery 教程
· 2019-03-10 10:58:52
实例
选取 <div> 元素同级的所有 <p> 元素:
$("div ~ p")
定义和用法
("element ~ siblings") 选择器选取指定元素 "element" 同级的所有元素。
比如:
- $("div ~ p") - 选取 <div> 元素同级的所有 <p> 元素。
注意:指定的两个元素共享相同的父元素。
语法
("element ~ siblings")
| 参数 | 描述 |
|---|---|
| element | 必需。任何有效的 jQuery 选择器。 |
| siblings | 必需。规定 element 参数的同级。 |
点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html
Web Design Handbook
Baeck, Philippe de 编 / 2009-12 / $ 22.54
This non-technical book brings together contemporary web design's latest and most original creative examples in the areas of services, media, blogs, contacts, links and jobs. It also traces the latest......一起来看看 《Web Design Handbook》 这本书的介绍吧!