jQuery Event Methods


jQuery Event Methods

Event methods make things happen or connect a function to something that responds to an action for the chosen items.

This table shows the various jQuery methods used for managing events.

Method / Property Description
bind() In version 3.0, this method is no longer recommended. Instead, please use the 'on()' method by clicking on this link: on(). This function is used to connect event handlers to elements.
blur() Attaches/Triggers the blur event
change() Connects/Activates the modification event.
click() Connects or activates the click action.
dblclick() Connects or activates the action that occurs when you double click.
delegate() Deprecated in version 3.0. Use the on() method instead. Attaches a handler to current, or future, specified child elements of the matching elements
die() This feature was taken out in version 1.9. It gets rid of all the special instructions that were attached using the live() method.
error() This was taken out in version 3.0. This causes the error event to be connected or triggered.
event.currentTarget The current element in the DOM during the event bubbling phase.
event.data This text is about information that can be given to a method when it's called during an event, like a function that does something when you click a button on a website. This information is not always required, but you can provide it if you want to.
event.delegateTarget This code returns the HTML element to which the current jQuery event handler is connected.
event.isDefaultPrevented() This code tells us if the "event.preventDefault()" function has been used on the event object.
event.isImmediatePropagationStopped() Determines if the event.stopImmediatePropagation() function was used on the event object.
event.isPropagationStopped() Checks if event.stopPropagation() was used on the event object.
event.namespace Provides the namespace that was chosen when the event happened.
event.pageX Shows where the mouse is compared to the document's left side.
event.pageY This code tells us where the mouse is on the webpage, but only in relation to the top part of the webpage.
event.preventDefault() Stops the event from doing its usual action.
event.relatedTarget Shows which element is being entered or exited when you move the mouse.
event.result This stores the most recent result from an action handler activated by a particular event.
event.stopImmediatePropagation() Stops other functions that handle events from running.
event.stopPropagation() Stops the event from moving up the DOM tree, so that any handlers in the parent elements don't get notified about the event.
event.target Shows the specific HTML element that caused the event.
event.timeStamp This tells you how many milliseconds have passed since January 1, 1970, when the event happened.
event.type Returns which event type was triggered
event.which Shows which key on the keyboard or button on the mouse was pressed during the event.
focus() Attaches/Triggers the focus event
focusin() Connects a function to the focusin event.
focusout() Adds a function to run when something loses focus.
hover() Adds two functions to respond when you move your mouse over something.
keydown() Connects or activates the keydown event.
keypress() Connects/Activates the keypress action.
keyup() Connects or activates the keyup event.
live() This feature was taken out in version 1.9. It lets you attach one or more functions to elements that are currently selected or will be selected in the future.
load() This feature was taken out in version 3.0. It connects a function to the load event.
mousedown() Causes the mousedown event to occur.
mouseenter() Connects or activates the mouseenter event.
mouseleave() Connects or activates the mouseleave action.
mousemove() Connects or activates the mousemove event.
mouseout() Connects or activates the mouseout action.
mouseover() Causes the mouseover action to happen.
mouseup() Connects or activates the mouse release event.
off() Deletes the event handlers linked to the 'on()' function.
on() Connects actions to things on a webpage.
one() Adds event listeners to chosen items. Each listener can respond to an event only once for each item.
$.proxy() It means you take a function that already exists and create a new one that behaves in a specific way.
ready() Describes a task to perform once the entire webpage has finished loading.
resize() Connects/Activates the resizing action.
scroll() Connects/Activates the scroll action.
select() Connects or activates the select event.
submit() Connects or activates the submission action.
toggle() This was taken out in version 1.9. It used to connect two or more actions for the click event.
trigger() Initiates all actions linked to the chosen elements.
triggerHandler() Fires all functions connected to a specific event for the chosen elements.
unbind() In version 3.0, it's outdated. Instead, you should use the "off()" method by clicking on this link: off(). This method removes an event handler that was previously added to specific elements.
undelegate() In version 3.0, this feature is outdated. Instead, utilize the 'off()' method by following the link provided. This method removes an event handler from chosen elements, whether it's done immediately or in the future.
unload() The old version (3.0) no longer has this. You should now use the "on()" or "trigger()" method. This connects a handler to the event when the page unloads.