Re: [jQuery] how to get href value

2010-01-23 Thread Andrei Eftimie
>> $(document).ready(function() { >>        $("a").click(function(event) { >>                alert( "You clicked a link to " + this.href ); >>                return false; >>        }); >> }); This method is very slow. Try using event delegation: $(document).ready(function() { $(document).cl

Re: [jQuery] how to get href value

2010-01-19 Thread adi sembiring
Got it ..., thanks all On Wed, Jan 20, 2010 at 1:22 PM, Michael Geary wrote: > But that would give you the href for the first A element in the document, > not necessarily the one you clicked. > > Going back to the OP's code, this.href would be the easiest way to get it: > > > $(document).ready(f

Re: [jQuery] how to get href value

2010-01-19 Thread Michael Geary
But that would give you the href for the first A element in the document, not necessarily the one you clicked. Going back to the OP's code, this.href would be the easiest way to get it: $(document).ready(function() { $("a").click(function(event) { alert( "You clicked

Re: [jQuery] how to get href value

2010-01-19 Thread Matt Quackenbush
$("a").attr("href");