Reputation: 25377
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?
Upvotes: 3
Views: 181
Reputation: 356
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?
Upvotes: 0