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
Rework
Jason Fried、David Heinemeier Hansson / Crown Business / 2010-3-9 / USD 22.00
"Jason Fried and David Hansson follow their own advice in REWORK, laying bare the surprising philosophies at the core of 37signals' success and inspiring us to put them into practice. There's no jarg......一起来看看 《Rework》 这本书的介绍吧!