1. 程式人生 > >小白必看 jquery選擇器

小白必看 jquery選擇器

jQuery選擇器分為

目錄

基本選擇器

層次選擇器

過濾選擇器

 基本過濾選擇器

 內容過濾選擇器

 可見性過濾選擇器

 屬性過濾選擇器

 子元素過濾選擇器

 表單物件屬性過濾選擇器

表單選擇器


基本選擇器

   ID選擇器    #id

   類選擇器    .class

   標籤名       div

   萬用字元        *

   組選擇器   select1,select2

層次選擇器

    空格    

    >

     +

     ~

過濾選擇器

 基本過濾選擇器

       :first

       :last

       :not(selector)

       :even

       :odd

       :eq(index)

       :gt(index)

       :lt(index)

       :header

       :animated

 內容過濾選擇器

        :contains()

        :empty

        :parent

        :has(selector)

 可見性過濾選擇器

         :hidden

         :visible

 屬性過濾選擇器

         :[attr]

         :[attr=val]

         :[attr!=val]

         :[attr^=val]

         :[attr$=val]

         :[attr*=val]

         [selector1][selector2][selectorN]

 子元素過濾選擇器

         :nth-child(index/odd/even/equation

         :first-child

         :last-child

         :only-child

 表單物件屬性過濾選擇器

         :enabled

         :disabled

         :checked

         :selected

表單選擇器

          :input

          :text

          :password

          :radio

          :checkbox

          :submit

          :image

          :reset

          :button

          :file

          :hidden