How to select anchor tag with specified class and rel?
Asked Answered
S

1

11

I have an anchor tag like this, and I need to select it!

<a href="#" class="foo bar" rel="123">...</a>

Is it possible with jQuery to write a selector that selects an anchor that has class like foo bar and rel like 123?

Stranglehold answered 27/7, 2011 at 6:30 Comment(0)
F
22

You can use something like:

$('a.foo.bar[rel="123"]')
Freak answered 27/7, 2011 at 6:32 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.