zoukankan      html  css  js  c++  java
  • 第二章-jQuery选择器

    一、jquery选择器的优势:

      ①简介的写法

      ②支持css1-css3选择器

      ③完善的处理机制

    二、jQuery选择器分类:

      ①基本选择器

        ①#id

        ②.class

        ③element

        ④*

        ⑤selector1,selector2,......

      ②层次选择器

        ①后代选择器

        ②$("parent>child") 儿子选择器

        ③$("prev+next")选择下一个同辈元素 等价于next()

        ④$("prev~siblings")选择后面的所有同辈元素  等价于nextAll()

        ps:siblings()匹配所有同辈元素,与前后位置无关

      ③过滤选择器

        ①基本过滤

          ①:first

          ②:last

          ③:not(selector)

          ④:even

          ⑤:odd

          ⑥:eq(index)

          ⑦:gt(index)

          ⑧:lt(index)

          ⑨:header

          ⑩:animated

          ⑪:focus

        ②内容过滤

          ①:contains(text)

          ②:empty

          ③:has(selector)

          ④:parent

        ③可见性过滤

          ①:hidden  注意:包含样式display:none/visibility:hidden的元素,或者文本隐藏域<input type="hidden"/>之类的元素

          ②:visible  

        ④属性过滤

          ①[attribute]

          ②[attribute=value]

          ③[attribute!=value]

          ④[attribute^=value]

          ⑤[attribute$=value]

          ⑥[attribute*=value]

          ⑦[attribute|=value]

          ⑧[attribute~=value]

          ⑨[attribute1][attribute2][attributeN]

        ⑤子元素过滤

          ①:nth-child(index/even/odd/equation)  例子::nth-child(3n) :nth-child(3n+1)

          ②:first-child

          ③:last-child

          ④:only-child

        ⑥表单对象属性过滤

          ①:enabled

          ②:disabled

          ③:checked  (针对单选框 复选框)

          ④:selected (针对下拉列表)

      ④表单选择器

        ①:input

        ②:text

        ③:password

        ④:radio

        ⑤:checkbox

        ⑥:submit

        ⑦:image

        ⑧:reset

        ⑨:button

        ⑩:file

        ⑪:hidden

  • 相关阅读:
    「日常训练」Single-use Stones (CFR476D2D)
    「日常训练」Greedy Arkady (CFR476D2C)
    「Haskell 学习」二 类型和函数(上)
    「学习记录」《数值分析》第二章计算实习题(Python语言)
    「日常训练」Alena And The Heater (CFR466D2D)
    Dubbo 消费者
    Dubbo 暴露服务
    Rpc
    git fail to push some refs....
    Spring Cloud (6)config 客户端配置 与GitHub通信
  • 原文地址:https://www.cnblogs.com/ishuanghe/p/5539031.html
Copyright © 2011-2022 走看看