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

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

问题描述

给定多个锚定标签:

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

如何选择匹配类和一些特定文本的锚点。例如选择所有具有类'myclass'和text:'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天全站免登陆