JavaScript jQuery 元素的选择器 w3cshool 上没有的,别人给我发的国外的资料,
天蓬老师
天蓬老师 2017-04-11 09:21:26
[JavaScript讨论组]

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.
匹配所有指定属性筛选器的元素。

天蓬老师
天蓬老师

欢迎选择我的课程,让我们一起见证您的进步~~

全部回复(1)
巴扎黑

http://www.w3school.com.cn/cssref/css_selectors.ASP

这个上面有的

有几个需要注意的是

|value 和 ^value : 二者都表示以value开头,但是前者表示需要包含value这样的单词(或者可以用value-abc)这种方式,或者则表示以value开头即可,可以死valueabc这种

~和*的区别也类似

热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号