jQuery :last-of-type 选择器

jQuery 教程 · 2019-03-10 08:28:21

实例

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

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

定义和用法

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

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

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

语法

$(":last-of-type")

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

查看所有标签

Web Design Index by Content 3 (Web Design Index)

Web Design Index by Content 3 (Web Design Index)

Pepin Press (EDT) / Pepin Press / 2007-11 / USD 29.99

Would you like an overview of the state of the art in web design in a specific field? WEB DESIGN INDEX BY CONTENT provides exactly that: every year, 500 new designs are selected and grouped in more th......一起来看看 《Web Design Index by Content 3 (Web Design Index)》 这本书的介绍吧!

Markdown 在线编辑器
Markdown 在线编辑器

Markdown 在线编辑器

RGB CMYK 转换工具
RGB CMYK 转换工具

RGB CMYK 互转工具