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

查看所有标签

Mobilizing Web Sites

Mobilizing Web Sites

Layon, Kristofer / 2011-12 / 266.00元

Everyone has been talking about the mobile web in recent years, and more of us are browsing the web on smartphones and similar devices than ever before. But most of what we are viewing has not yet bee......一起来看看 《Mobilizing Web Sites》 这本书的介绍吧!

CSS 压缩/解压工具
CSS 压缩/解压工具

在线压缩/解压 CSS 代码

XML、JSON 在线转换
XML、JSON 在线转换

在线XML、JSON转换工具

html转js在线工具
html转js在线工具

html转js在线工具