window.fn = function(e) { alert('you clicked ' + this.innerHTML); e.stopPropagation(); } g('div').addEvent('click', fn, false);
Try It
Add Element
Gimme
div#zoo / classes: dog horse cat mouse
div#dogMouse / classes: dog mouse
div#spike / classes: dog
p#trio / classes: dog cat mouse
p#llama / classes: animal llama
span#alphabet / classes: a b c ... x y z
a#yahoo / classes: link
a#steve / classes: link mail