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

查看所有标签

ppk on JavaScript, 1/e

ppk on JavaScript, 1/e

Peter-Paul Koch / New Riders Press / 2006-09-20 / USD 44.99

Whether you're an old-school scripter who needs to modernize your JavaScripting skills or a standards-aware Web developer who needs best practices and code examples, you'll welcome this guide from a J......一起来看看 《ppk on JavaScript, 1/e》 这本书的介绍吧!

JS 压缩/解压工具
JS 压缩/解压工具

在线压缩/解压 JS 代码

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

在线XML、JSON转换工具

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

HEX HSV 互换工具