How to pass event as argument to an inline event handler in JavaScript?
to pass the event object: <p id=”p” onclick=”doSomething(event)”> to get the clicked child element (should be used with event parameter: function doSomething(e) { e = e || window.event; var target = e.target || e.srcElement; console.log(target); } to pass the element itself (DOMElement): <p id=”p” onclick=”doThing(this)”> see live example on jsFiddle. You can specify the name … Read more