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 <http://jquery.com/>a link to " +
this.href );
               return false;
       });
});

-Mike

On Tue, Jan 19, 2010 at 9:14 PM, Matt Quackenbush <quackfu...@gmail.com>wrote:

> $("a").attr("href");
>
>

Reply via email to