views:

34

answers:

1

hi,

i'm having this markup:

<a href='#' onclick='loadpage(121);'>
<a href='#' onclick='loadpage(122);'>
<a href='#' onclick='loadpage(123);'>

my question: how can i select the 2nd link object by jQuery using the id 122? i've tried something like $("a[onclick=loadpage(122)]") but didn't work.

thx

+3  A: 

Try adding in the ; and placing the loadpage(122); in single quotes.

Try it out: http://jsfiddle.net/PQB5U/

$("a[onclick='loadpage(122);']")​
patrick dw
that helped - thanks a lot!
Fuxi
@Fuxi - You're welcome. :o)
patrick dw