Is there a way to take the current target of an event with IE 7 or 8?
With other browser (firefox, opera, chrome etc.) we can use
event.currentTarget
or
You could always use a closure and pass in the element the event handler has been attached to. Something along these lines...
function handlerOnClick (currentTarget) {
return function () {
console.log(currentTarget);
}
}
var domElement = document.createElement('DIV');
domElement.innerHTML = 'Click me!';
domElement.onclick = handlerOnClick(domElement);
document.body.appendChild(domElement);