[jQuery] Re: How do I get the actual HREF of a link?

2009-01-26 Thread Karl Swedberg
On Jan 26, 2009, at 12:56 AM, jQuery Lover wrote: You can also try this: $('#testlink')[0].getAttribute('href'); Returns whatever is in your href... Actually, in IE, where I'm guessing the problem is occurring, you need to set the iFlags argument to 2 in order to get the actual value of

[jQuery] Re: How do I get the actual HREF of a link?

2009-01-26 Thread seangates
I've used this a hundred times: $('#testlink').attr('href'); Don't make jQuery more complicated than it has to be. -- Sean On Jan 26, 7:32 am, Karl Swedberg k...@englishrules.com wrote: On Jan 26, 2009, at 12:56 AM, jQuery Lover wrote: You can also try this:

[jQuery] Re: How do I get the actual HREF of a link?

2009-01-26 Thread Karl Swedberg
My point exactly. --Karl On Jan 26, 2009, at 10:10 AM, seangates wrote: I've used this a hundred times: $('#testlink').attr('href'); Don't make jQuery more complicated than it has to be. -- Sean On Jan 26, 7:32 am, Karl Swedberg k...@englishrules.com wrote: On Jan 26, 2009, at 12:56

[jQuery] Re: How do I get the actual HREF of a link?

2009-01-25 Thread brian
$('#testlink')[0].attr('href') On Sun, Jan 25, 2009 at 9:14 PM, Jumpfroggy rocketmonk...@gmail.com wrote: Here's the short version: I have a link: a id=testlink href=page.htmlpage.html/a But when I do this: alert($('#testlink')[0].href); I get this: http://localhost/page.html

[jQuery] Re: How do I get the actual HREF of a link?

2009-01-25 Thread Ricardo Tomasi
That won't work, [0] will give you the DOM element. $('#testlink').attr('href') jQuery will take care of getting the actual attribute value only. On Jan 26, 12:57 am, brian bally.z...@gmail.com wrote: $('#testlink')[0].attr('href') On Sun, Jan 25, 2009 at 9:14 PM, Jumpfroggy

[jQuery] Re: How do I get the actual HREF of a link?

2009-01-25 Thread jQuery Lover
You can also try this: $('#testlink')[0].getAttribute('href'); Returns whatever is in your href... Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Mon, Jan 26, 2009 at 7:14 AM, Jumpfroggy rocketmonk...@gmail.com wrote: Here's the short version: I have a link: