开发者

Find and Hide element (jQuery)

开发者 https://www.devze.com 2022-12-17 00:41 出处:网络
<a href=\"#\">Hide Me</a> How do I find a link with text \"hide\" in it. I know how to find links by attributes but ca开发者_开发问答n\'t figure out how to find link by its text.$(\'a:co
<a href="#">Hide Me</a>

How do I find a link with text "hide" in it. I know how to find links by attributes but ca开发者_开发问答n't figure out how to find link by its text.


$('a:contains(Hide)')

Note that contains is case sensitive.

$('a:contains(Hide)').click(function() { $(this).hide() });


$('a:contains("Hide")');

see this post
see jQuery docu

0

精彩评论

暂无评论...
验证码 换一张
取 消