![jQuery [attribute^=value] 属性选择器](https://cdn.div.cn/static/images/46803030d0d8d1612a6fc16441da9ad4.png)
[ attribute ^ = value ]选择器用于选择属性值以指定value开头的元素。
语法:
$("[attribute^=value]")实例
选择每个<a>元素具有href属性值并以“ https”开头:
$(document).ready(function(){
$("a[href^=https]").css({"background":"green", "color":"white"});
});测试看看‹/›参数值
| 参数 | 描述 |
|---|---|
| attribute | 指定要选择的属性名称 |
| value | 指定值应以其开头的字符串 |