How can I get the URL of a link?
$('.l').eq(0).href
is what I want to do, but it's undefined.
So given a jQuery selected anchor element, how do you get the href property?
How can I get the URL of a link?
$('.l').eq(0).href
is what I want to do, but it's undefined.
So given a jQuery selected anchor element, how do you get the href property?
Are you sure you're selecting the link? Because I'm trying this in my site and ir works just fine:
$('#id')[0].href
I mean, are you sure the $('.l').eq(0) part is working?
Foo
`. Would the question make sense? That's why you need to post your HTML. – Álvaro González Aug 23 '11 at 07:00