jQuery选择器

请列举出在CSS中学习过的选择器的类型

 

 

 

jQuery选择器的优势有哪些?

 

1. 简洁的写法

2. 提供了完善的处理机制 

3. 判断dom节点存在的方法

4.css1-css3的选择器 jQuery都能用

jQuery选择器包括哪几大类?

(1)基本

#id

element
.class
*
selector1,selector2,selectorN
(2)层次选择器:
ancestor descendant
parent > child
prev + next
prev ~bai siblings
(3)基本过滤器选du择器
:first
:last
:not
:even
:odd
:eq
:gt
:lt
:header
:animated
(4)内容过滤器选择器
:contains
:empty
:has
:parent
(5)可见性过zhi滤器选择器
:hidden
:visible
(6)属性过滤器选择器
[attribute]
[attribute=value]
[attribute!=value]
[attribute^=value]
[attribute$=value]
[attribute*=value]
[attrSel1][attrSel2][attrSelN]
(7)子元素过滤器选择器
:nth-child
:first-child
:last-child
:only-child
(8)表单选择器
:input
:text
:password
:radio
:checkbox
:submit
:image
:reset
:button
:file
:hidden
(9)表单过滤器选择器
:enabled
:disabled
:checked
:selected

通过位置选取元素的jQuery选择器有哪些?

:eq(i)第几个

:gt(i)大于等于i 的元素集合
:lt(i)小于等于i 的元素集合
:first第一个
:last最后一个
:even 偶数项
:odd 奇数项

posted @ 2020-08-07 13:54  劲夫劲夫全场欢呼  阅读(123)  评论(0)    收藏  举报