// http://jsfiddle.net/s1o8a335/ window.addEventListener("load", load_handler); document.body.addEventListener("click", click_handler); function load_handler(evt) { logEvent(evt); document.body.click(); } function click_handler(evt) { logEvent(evt); } function logEvent(evt) { var output = document.getElementById("log"); var logLines = [ ["Event name", evt.type], ["InstanceOf Event", evt instanceof Event], ["InstanceOf UIEvent", evt instanceof UIEvent], ["InstanceOf MouseEvent", evt instanceof MouseEvent], ["toString", evt.toString()] ].map(function (arr) { return arr.join(": "); }); output.innerHTML += logLines.join("<br>") + "<br><br>"; }