I have four buttons and want to trace which one is pressed. In some of them I changed innerHTML property with HTML tag. Then I noticed that when a button is pressed there is
Use currentTarget instead. From MDN:
It always refers to the element the event handler has been attached to as opposed to event.target which identifies the element on which the event occurred
function clickHandler(me){
console.log(me.currentTarget);
}
Here is a fiddle to demonstrate the above.