Oops, small typo:

function tellme(obj) {
    alert(obj.href);
}

On Aug 21, 12:57 pm, James <james.gp....@gmail.com> wrote:
> You'd have to pass the reference of the clicked object to tellme(),
> otherwise it has no access to anything from where it's called.
>
> $("a.someLinks").click(function(event){
>     tellme(this);
>
> });
>
> function tellme(obj) {
>     alert(this.href);
>
> }
>
> On Aug 21, 12:53 pm, Audrey A Lee <audrey.lee.is...@gmail.com> wrote:
>
> > jQuery People,
>
> > Suppose I have this syntax:
>
> > $("a.someLinks").click(function(event){tellme();});
>
> > I want tellme() to handle the value of href of the clicked link.
>
> > What syntax do I put in tellme()?
>
> > I got this far:
>
> > function tellme() {
> >   // does not work: alert($(this)[0].href);
> >   // does not work: alert($(this)[0].getAttribute("href"));
> >   // This only works in Safari: alert($(this)
> > [0].event.currentTarget.href);
>
> > }
>
> > Here is a bigger question:
> > How would I get this info from the API documentation?
>
> > -Audrey
>
>

Reply via email to