jQuery :first-child 选择器
jQuery 教程
· 2019-03-10 07:43:41
实例
选取属于 <p> 的父元素中第一个为 <p> 的元素:
$("p:first-child")
定义和用法
:first-child 选择器选取属于其父元素的第一个子元素。
提示:请使用 :last-child 选择器来选取属于其父元素的最后一个子元素。
语法
$(":first-child")
点击查看所有 jQuery 教程 文章: https://codercto.com/courses/l/35.html