jQuery 选择器
选取属于其父元素的第一个 <p> 元素的每个 <p> 元素:
:first-of-type 选择器选取属于其父元素的特定类型的第一个子元素的所有元素。
提示:该选择器与 :nth-of-type(1) 相同。
提示:请使用 :last-of-type 选择器来选取属于其父元素的特定类型的最后一个子元素的所有元素。
选取所有 <div> 元素的第一个 <p> 元素
如何选取所有 <div> 元素的第一个 <p> 元素。
:first、:first-child 和 :first-of-type 之间的不同
演示 :first、:first-child 和 :first-of-type 选择器之间的不同。
jQuery 选择器
jQuery focusout() 方法jQuery 事件方法实例 当 div 元素或其任意子元素失去焦点时,设置 div 元素的背景颜色:$("div").focusou...
jQuery next() 方法jQuery 遍历方法实例 返回带有类名 start 的每个 li 元素的后一个同级元素:$(document).ready(function(){ $...
jQuery :first 选择器jQuery 选择器实例 选取第一个 p 元素:$(p:first) 定义和用法 :first 选择器选取第一个元素。 注意:这个...
jQuery :visible 选择器jQuery 选择器实例 选取所有可见的 p 元素:$(p:visible) 定义和用法 :visible 选择器选取当前可见的每个...