• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

jquery有几种选择器?

jquery 搞代码 4年前 (2021-12-27) 28次浏览 已收录 0个评论

jquery有几种选择器?

很多种,大概归纳为9种。

1、基本的有id、标签、类、通配符选择器:

#id
element
.class
*

2、层次选择器:

ancestor descendant
parent > child
prev + ne<mark style="color:transparent">来源gaodaimacom搞#^代%!码网</mark>xt
prev ~ siblings

3、基本过滤器选择器

:first
:last
:not
:even
:odd
:eq
:gt
:lt
:header
:animated

4、内容过滤器选择器

:contains
:empty
:has
:parent

5、可见性过滤器选择器

: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答疑栏目,欢迎学习!

以上就是jquery有几种选择器?的详细内容,更多请关注gaodaima搞代码网其它相关文章!


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:jquery有几种选择器?

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址