Handling Events

The following are the JQuery library functions to handle events for your DOM elements.


  1. Keyboard events
  2. Mouse Events
  3. Browser Events
  4. Form Events

Focusin : $(selector).focusin(function())

The .focusin() event is used to focus the element when it gets triggered.

Focusout : .focusout()

The .focusout() event is used to bind a function when an element or anyother element inside it loses focus.

Keydown : $(selector).keydown(function)

The .keydown() event binds a function to an event on an element whenever it is triggered.

Keyup : $(selector).keyup(function)

The .keyup() event binds a function to an event on an element whenever it is triggered.

Keypress : $(selector).keypress(function)

The .keypress() event binds a function to an event on a element when gets triggered.


Click : .click()

The .click() event is used to trigger or bind a function to the click event of the selected element.

Double click : .dblclick()

The .dbclick() event is used to trigger or bind a function to the double click event of the selected element.

Focusin : .focusin()

The .focusin() event is used to bind a function when an element gains focus.

Focusout : focusout()

The .focusout() event is used to bind a function when an element or anyother element inside of it loses focus.

Mouse Hover: .hover( handlerIn(eventObject), handlerOut(eventObject) )

The .hover() event is used to combine the actions of both mouseenter and mouseleave.

Mouse over: .mouseover()

The .mouseover() event is used to trigger an action when the mouse is moved over a particular element.

Mouse up: .mouseup( handler(eventObject) )

The .mouseup() event is used to perform a function when the mouse pointer pressed up on the element.

Mouse down: .mousedown( handler(eventObject) )

The .mousedown() event can be used to perform a handler function when the pointer is pressed and not released from the element.Function will be performed without the pointer release from element.

Mouse Enter: .mouseenter( handler(eventObject) )

The .mouseenter() event can be used to perform a function while the mouse pointer enters the particular element.

Mouse Leave: .mouseleave( handler(eventObject) )

The .mouseleave() event can be used to perform a function when the mouse pointer is leaving from an element.

Mouse Move: .mousemove()

The .mousemove() event is used to trigger an action when the mouse is moved over an element.

Mouse Out: .mouseout()

The .mouseout() event used to trigger an action when the mouse is moved out of a particular element. The mouseout event occurs when the pointing device gets out of the element.

Toggle : .toggle()

The toggle() event triggers or binds two or more event handler of an specified element in alternate clicks.


Resize: .resize()

The .resize() events triggers or binds the event handler to the resize event of an element.

Scroll: .scroll()

The.scroll() event triggers or binds the event handler to the scroll event of an element.


Form Blur: .$(selector).blur(function)

The .blur() event is used to lose or blur focus of the specified element when it gets triggered.

Change Event: $(selector).change(function)

The .change() event is used to change the value of the specified element when it gets triggered..

Focus Event: $(selector).focus(function)

The .focus() event is used to focus the specified element when it gets triggered.

Select Event: $(selector).select(function)

The .select() event is triggered when the text in the text input field or in the text area is selected.

Submit Event: $(selector).submit(function)

The .submit() event is executed when the form is submitted. It only works with form elements.




Ask Questions

Ask Question