CSS属性选择器技巧

匹配a里面有href属性的标签

$("a[href]")

匹配a里面有href属性的值包含com值的。

a[href*=".com"]

匹配a里面的href属性值是https:开头的。

a[href^="https:"] 

匹配a里面href属性是/dev-tips结尾的

a[href$="/dev-tips"]

匹配a里面title值为home的,其中i表示不区分大小写

$('a[title="home" i]')

https://umaar.com/dev-tips/229-css-attribute-selectors/

posted @ 2021-04-07 23:34  公众号python学习开发  阅读(59)  评论(0编辑  收藏  举报