Skip to content Skip to sidebar Skip to footer

Id Of A Link That A Function Is Called From

I hope it's not a problem to post much specific code here, but I figure it will be better explained if everyone can just see it, so I will give you my code and then I will explain

Solution 1:

Try this:

beGoneLink.addEventListener("click", beGone, false);

beGone = function (evt) {
    evt.target; // evt.target refers to the clicked element.
       ...
}

You can then use evt.target.id, evt.target.parentNode, etc.

Post a Comment for "Id Of A Link That A Function Is Called From"