user3376905
user3376905

Reputation: 177

How to find an <a> element that has an href value that contains two given strings

Something like this:

$("a[href*='string1' && 'string2']")

I tried that code without success. I also tried:

$("a:contains('string1' && 'string2')")

That one just gives me a elements that contain string 2. How would I go about doing this? Thanks in advance.

Upvotes: 0

Views: 62

Answers (1)

Rajaprabhu Aravindasamy
Rajaprabhu Aravindasamy

Reputation: 67217

You can combine two attribute selector to make it as an and operation.

Try,

$("a[href*='string1'][href*='string2']")

Upvotes: 5

Related Questions