jQuery :first-of-type 选择器

jQuery 教程 · 2019-03-10 07:58:50

实例

选取属于其父元素的第一个 <p> 元素的每个 <p> 元素:

$("p:first-of-type")

定义和用法

:first-of-type 选择器选取属于其父元素的特定类型的第一个子元素的所有元素。

提示:该选择器与 :nth-of-type(1) 相同。

提示:请使用 :last-of-type 选择器来选取属于其父元素的特定类型的最后一个子元素的所有元素。

语法

$(":first-of-type")

点击查看所有 jQuery 教程 文章: https://www.codercto.com/courses/l/35.html

查看所有标签

Measure What Matters

Measure What Matters

John Doerr / Portfolio / 2018-4-24 / GBP 19.67

In the fall of 1999, John Doerr met with the founders of a start-up he’d just given $11.8 million, the biggest investment of his career. Larry Page and Sergey Brin had amazing technology, entrepreneur......一起来看看 《Measure What Matters》 这本书的介绍吧!

图片转BASE64编码
图片转BASE64编码

在线图片转Base64编码工具

HTML 编码/解码
HTML 编码/解码

HTML 编码/解码

HSV CMYK 转换工具
HSV CMYK 转换工具

HSV CMYK互换工具