当前位置 博文首页 > 文章内容

    jQuery选择器

    作者: 栏目:未分类 时间:2020-08-07 14:00:26

    本站于2023年9月4日。收到“大连君*****咨询有限公司”通知
    说我们IIS7站长博客,有一篇博文用了他们的图片。
    要求我们给他们一张图片6000元。要不然法院告我们

    为避免不必要的麻烦,IIS7站长博客,全站内容图片下架、并积极应诉
    博文内容全部不再显示,请需要相关资讯的站长朋友到必应搜索。谢谢!

    另祝:版权碰瓷诈骗团伙,早日弃暗投明。

    相关新闻:借版权之名、行诈骗之实,周某因犯诈骗罪被判处有期徒刑十一年六个月

    叹!百花齐放的时代,渐行渐远!



    请列举出在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 奇数项