I'm working with a big framework, which is entity component based. So I can't change the code of the element sending the event at all, I can only work with the receiving element.
this.id does not work, because the component ( so the event handler) is attached to a parent element of the element sending the event.
I'm working with javascript, no jquery.
I wondered if there was a way to find out inside the event handler of the receiving element: which element originally sent the event?
I tried browsing other solutions like
function doWithThisElement(event) {
event = event || window.event; // IE
var target = event.target || event.srcElement; // IE
var id = target.id;
//...
}
but it doesn't work for me.