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

  • 相关阅读:
    改变Edit的光标(使用CreateCaret,ShowCaret和LoadBitmap三个API函数)
    浅析Delphi Container库(有开源的DCLX)
    Delphi接口的底层实现(接口在内存中仍然有其布局,它依附在对象的内存空间中,有汇编解释)——接口的内存结构图,简单清楚,深刻 good
    Asp.Net在多线程环境下的状态存储问题
    C#程序中注释过多的8条理由
    CentOS 6.4 编译安装LLVM3.3,Clang和Libc++
    Microsoft 2013校园招聘笔试题及解答
    代码契约CodeContract(八)
    T-SQL 临时表、表变量、UNION
    BST&AVL&红黑树简单介绍
  • 原文地址:https://www.cnblogs.com/ishuanghe/p/5539031.html
Copyright © 2011-2022 走看看