I have a div with onclick param:
<div onclick="some_function()"></div>
How can I access the event object inside the function? I need it to get event.target
function some_function()
{
event = event || window.event;
var target = event.target || event.srcElement;
//does not work in IE and Firefox, but works in chrome
}
Use the event to get to the target. Beware of target vs currentTarget issues:
https://developer.mozilla.org/en-US/docs/Web/API/Event/currentTarget