The HTML DOM object model defines an Event
object with a target property.
Looking at MSDN, Microsoft documents a target property. They also document srcElem
The easy way to archive this is by using:
var target = event.target || event.srcElement;
The way this works is because:
event.target
is a truthy which if does not exist in that browser will evaluate to false.event.srcElement
.And with this you will end up with the first value that is present on the current browser where the code is executed.