jqueryjquery-selectorsanchorrel

How to select anchor tag with specified class and rel?


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?


Solution

  • You can use something like:

    $('a.foo.bar[rel="123"]')