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

查看所有标签

APIs

APIs

Daniel Jacobson、Greg Brail、Dan Woods / O'Reilly Media / 2011-12-24 / USD 24.99

Many of the highest traffic sites get more than half of their traffic not through the browser but through the APIs they have created. Salesforce.com (more than 50%) and Twitter (more than 75% fall int......一起来看看 《APIs》 这本书的介绍吧!

MD5 加密
MD5 加密

MD5 加密工具

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

在线XML、JSON转换工具

HEX HSV 转换工具
HEX HSV 转换工具

HEX HSV 互换工具