Select <a> which is the second <a> on a page that contains the same href text? jQuery
Posted
by Alex
on Stack Overflow
See other posts from Stack Overflow
or by Alex
Published on 2010-05-17T17:37:14Z
Indexed on
2010/05/17
17:50 UTC
Read the original article
Hit count: 130
jQuery
|jquery-selectors
Hello there,
I'm working with a page that has several links that contain the same href text, and I need to select the second anchor element on the page that contains said href text. Here's a simplified version of the link structure of the page:
<a href="same/link/to/stuff/">same link</a>
<a href="same/link/to/stuff/">same link</a>
How do I fashion my selector so that it only selects the second anchor in the above example?
Currently I'm trying:
$('a[href=same/link/to/stuff/] :eq(1)')
but it is not working.
Thanks!!
© Stack Overflow or respective owner