document.body.onclick = function(e) {
var clickedEl = window.event ? event.srcElement : e.target;
while (clickedEl != null) {
if (clickedEl.className
&& (" " + clickedEl.className + " ").indexOf(" yourclass ") != -1) {
// do something, e.g.,
alert("Element with class was clicked");
return;
}
clickedEl = clickedEl.parentNode;
}
}