如何选择具有特定文本的所有锚标记 [英] How to select all anchor tags with specific text

查看:19
本文介绍了如何选择具有特定文本的所有锚标记的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

给定多个锚标签:

<a class="myclass" href="...">My Text</a>

如何选择与类匹配并带有一些特定文本的锚点.例如选择所有具有类的锚点:'myclass' 和文本:'My Text'

How do I select the anchors matching the class and with some specific text. eg Select all anchors with the class:'myclass' and text:'My Text'

推荐答案

$("a.myclass:contains('My Text')")

这篇关于如何选择具有特定文本的所有锚标记的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆