Event Object


When an event occurs in jQuery, an event object is automatically passed to the function.

This object contains information about the event and the element that triggered it.

The event object helps developers understand what action occurred and how it happened.

The event parameter holds details such as event type, target element, and mouse position.

The preventDefault method stops the browser’s default behavior.

It is widely used in form submissions and link clicks.

The stopPropagation method prevents the event from bubbling up to parent elements.

Event Object Notes:

  • Passed automatically to event functions
  • Contains event details
  • preventDefault stops default action
  • stopPropagation controls event flow