Bharanikumar
Bharanikumar

Reputation: 25733

jquery - e refer as Event

In my jquery snippet, am using the function(e) and also in some places i used function(event)

How system really understand the e is the event object,

is any where they declared by default ,

Upvotes: 0

Views: 66

Answers (1)

Nick Craver
Nick Craver

Reputation: 630389

It doesn't matter what you call the event object (as long as it's not a keyword), it's whatever the first parameter is, you're just giving it an identifier.

For example, you could call it wakyThing and it'd still work...it's still the first argument passed to the handler. This is the same for all jQuery handlers, from the docs:

The event object is guaranteed to be passed to the event handler.

Upvotes: 3

Related Questions