jQuery的选择器
作者:互联网
向下遍历
- find() : 返回被选元素的后代元素,一路向下直到最后一个后代。(类似于css 空格选择器 )
- children() : 返回被选元素的所有直接子元素。(类似于css +选择器 )
this元素的直接子元素选择器
jQuery(this).children('.race-day-info')
向上遍历
- parent() : 返回被选元素的直接父元素。
- parents() :返回被选元素的所有祖先元素,它一路向上直到文档的根元素html
- parentsUntil() :返回介于两个给定元素之间的所有祖先元素
水平遍历
- siblings() : 返回被选元素的所有同胞元素
- next() : 返回被选元素的下一个同胞元素
- nextAll() : 返回被选元素的所有跟随的同胞元素。
- nextUntil() :返回介于两个给定参数之间的所有跟随的同胞元素
(在 DOM 树中沿着同胞元素向后遍历,而不是向前)
- prev() : 返回被选元素的上一个同胞元素
- prevAll() : 返回被选元素的所有前面的同胞元素。
- prevUntil() : 返回介于两个给定参数之间的所有前面的同胞元素
this元素的兄弟选择器
jQuery(this).siblings('li')
过滤
- first() : 返回被选元素的首个元素
- last() : 返回被选元素的最后一个元素
- eq() : 返回被选元素中带有指定索引号的元素(索引号从 0 开始,因此首个元素的索引号是 0 而不是 1)
- filter() : 允许您规定一个标准。不匹配这个标准的元素会被从集合中删除,匹配的元素会被返回
- not() : 返回不匹配标准的所有元素
返回类不是old和new的所有元素的所有元素
jQuery('#datetimepicker .day').not('.old').not('new')
标签:jQuery,返回,所有,元素,同胞,选择器 来源: https://blog.csdn.net/qq_35752802/article/details/100534156