event.originalEvent jQuery

event.originalEvent is usually just the native event (also described here).

However, if the browser is compatible, and the event was a touch event then that API will be exposed through event.originalEvent.

The short answer is that event.originalEvent is not always the same, it depends on which event type triggered the handler, and on the environment of the browser.


I have a case which I needed to use event.originalEvent the problem was trying to get an instance of a dropped file via drag and drop using the drop event, this is what happened

var files = event.dataTransfer.files; // Gives error: trying to get property of undefined

while writing

var files = event.originalEvent.dataTransfer.files; // Works fine

That means jQuery doesn't wrap the native browser event with all its APIs like the File API in this example, so to get access to those excluded properties and functions from the jQuery event we must use event.originalEvent. Hope that helps someone.