document.onclick = function(e){
var e=(e||event);
var o=e["target"]||e["srcElement"];
var s =o.tagName+"----"+o.getAttribute("class");
var obj= o.parentNode;
var i =20;
while (obj) {
if(obj.tagName == 'HTML')
{
break;
}
s =obj.tagName+"--class="+obj.getAttribute("class")+"\n"+s;
obj = obj.parentNode
}
alert(s);
}