document.onmousedown = function(e) { event = e || window.event; //在Internet Explorer里event是全局变量,会被存储在window.event里,firefox中 ,event事件会被相应的自定义函数获取 var obj = event.target || event.srcElement; //firefox支持event.target,ie支持event.srcElement alert(obj.nodeName); }