JavaScript jQuery 元素的选择器 w3cshool 上没有的,别人给我发的国外的资料,
我也不认识英语,但是我用百度都翻译了,别说我懒了哈,但是翻译的也不通顺,希望大家认识的一人一条帮忙翻译一下呗,谢谢了!
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 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.
选择具有指定属性的元素,其值与给定的字符串正是。
Multiple Attribute Selector name=”value”
Matches elements that match all of the specified attribute filters.
匹配所有指定属性筛选器的元素。
巴扎黑2017-04-11 09:23:26
http://www.w3school.com.cn/cssref/css_selectors.ASP
这个上面有的
有几个需要注意的是
|value 和 ^value : 二者都表示以value开头,但是前者表示需要包含value这样的单词(或者可以用value-abc)这种方式,或者则表示以value开头即可,可以死valueabc这种
~和*的区别也类似