Jquery选择器


*jquery选择器:  $('')

                    

                        

                      1 $('div')  标签选择器  ----> 选择页面上的所有div标签

                           

                      2 $('#dd')  id选择器          选择到页面上id值时dd的标签

                           

                      3 $('.aaa') class选择器       选择的是页面 class属性值时 aaa的所有标签

                     

                      4 后代选择器  E F 

                     

                      5 子标签选择器 E>F

                     

                      6 直接后兄弟选择器(adjacentsibing) E+F

                  

          7 后兄弟选择器(General silbling) E~F

                             

                      8 多元素选择器(MultipleElements) E,F,G     

 

 

       -----------------------------------------

 

           9 $('li:nth-child(2)'):选择到的是li节点 ,这个li节点是它的父节点的第2个孩子

                           

                            10 $('li:first-child'): 选择到li节点,这个li节点是它父节点的第一个孩子

                           

                            11$('li:last-child')

                           

                            12$(':only-child') 哪个节点是它的父节点的唯一孩子,将会被选中

 

                       13 :not(s)       $('li:not(:last-child)')

                           

                            14$(':empty')选到没有孩子的节点

 

           15 通用选择器: $('*')  $('p>*')

                           

                            -------------------------------------------------------

                           

                           

           属性选择器:

 

            1 、$('p[class]')

 

            2 、$('input[name=myname]')  

 

            3、 $('input[name!=myname]')

 

            4、 $('input[name^=my]')   

 

            5、$('input[name$=my]')     

 

            6  $('a[href*=example.com]')                        

                           

 

         表单选择器:

                  

                  

                       :input $(":input") 所有 <input> 元素 

                            :text   $ (":text")  所有type="text" 的 <input> 元素 

                            :password   $(":password")  所有type="password" 的 <input> 元素 

                            :radio  $(":radio") 所有type="radio" 的 <input> 元素 

                            :checkbox   $(":checkbox")  所有type="checkbox" 的 <input> 元素 

                            :submit$(":submit")    所有type="submit" 的 <input> 元素 

                            :reset  $(":reset") 所有type="reset" 的 <input> 元素 

                            :button$(":button")    所有type="button" 的 <input> 元素 

                            :image  $(":image") 所有type="image" 的 <input> 元素 

                            :file   $(":file")  所有type="file" 的 <input> 元素 

                                      

                            :enabled    $(":enabled")   所有激活的 input 元素 

                            :disabled   $(":disabled")  所有禁用的 input 元素 

                            :selected   $(":selected")  所有被选取的 input 元素 

                            :checked    $(":checked")   所有被选中的 input 元素</pre><br>

 


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值