Javascript event detection

Posted by Ben Shelock on Stack Overflow See other posts from Stack Overflow or by Ben Shelock
Published on 2010-04-30T09:39:35Z Indexed on 2010/04/30 9:47 UTC
Read the original article Hit count: 440

Filed under:
|
|

I can't find any good documentation on this suprisingly so I'm posting it here.

What's the raw javascript equivilent to this:

$(elem).click(function(){
    alert(this.text());
});

All I can find is this <elem onlick="func()" /> which is not what I want, I want to be able to do it just with javascript not within the context of an element.

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about jQuery