jQuery Cheatsheet

58 篇文章 0 订阅
2 篇文章 0 订阅

Attribute Selector


To identify the elements by their attributes:

前缀(Attribute Contains Prefix Selector)[name|="value"]选定的元素将符合以下条件,元素的该属性等于指定的值,或者该属性的前面部分是指定的值加上横线“-”。(Selects elements that have the specified attribute with a value either equal to a given string or starting with that string followed by a hyphen (-).)
包含(Attribute Contains Selector)[name*="value"](Selects elements that have the specified attribute with a value containing the a given substring.)
包含单词(Attribute Contains Word Selector)[name~="value"](Selects elements that have the specified attribute with a value containing a given word, delimited by spaces.)
结尾(Attribute Ends With Selector)[name$="value"](Selects elements that have the specified attribute with a value ending exactly with a given string. The comparison is case sensitive.)
等值(Attribute Equals Selector)[name="value"](Selects elements that have the specified attribute with a value exactly equal to a certain value.)
不等值(Attribute Not Equal Selector)[name!="value"](Select elements that either don’t have the specified attribute, or do have the specified attribute but not with a certain value.)
起始(Attribute Starts With Selector)[name^="value"](Selects elements that have the specified attribute with a value beginning exactly with a given string.)
持有属性(Has Attribute Selector)[name](Selects elements that have the specified attribute, with any value.)
多重属性(Multiple Attribute Selector)[name="value"][name2="value2"](Matches elements that match all of the specified attribute filters.)


Ref:

Category: Attribute


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值