How do I select an <a href="...">foo</a> DOM node, knowing foo?
How do I select an <a href=…>foo</a> DOM node, knowing foo ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can use
.filter(), like this:There’s also the
:contains()selector if you don’t need an exact match, like this:Instead of an exact match, this works if the text you’re looking for is anywhere in the element.
Alternatively, if you wanted to match exactly and do it often, create a selector for that, like this:
Then you could use it anytime after, like this: