Advertisement

Google Ad Slot: content-top

jQuery Events

~1 min read · JQuery
On this page

What Are jQuery Events?

Events are actions that happen in the browser — like when a user clicks a button, hovers over text, types into a form, or when a page finishes loading.

jQuery makes it super easy to detect and respond to these events using simple methods.

Mouse Event

Eeyboard Event

Form Event

click()

keydown()

focus()

dblclick()

keypress()

blur()

mouseenter()

keyup()

change()

mouseleave()


submit()

mousedown()



mouseup()



hover()



Mouse Event


These trigger when the user interacts with the mouse.


1) click() Event


Fires when an element is clicked

Example
Try it yourself

2) dblclick() Event


Fires when an element is double-clicked

Example
Try it yourself

3) mouseenter() Event


Fires when the mouse enters an element

Example
Try it yourself

4) mouseleave() Event


Fires when the mouse leaves an element

Example
Try it yourself

5) mouseup() Event


When mouse button is pressed down

Example
Try it yourself

6) mousedown() Event



When mouse button is released

Example
Try it yourself

7)  hover() Event


Shortcut for mouseenter + mouseleave

Example
Try it yourself

Keyboards Event


1) keydown() Event


Fires when a key is released

Example
Try it yourself

2) keyup() Event


Fires when a key is pressed down

Example
Try it yourself

3) keypress() Event


The keypress event in jQuery is triggered when the user presses a key on the keyboard. It works primarily for character keys (like letters and numbers), but does not detect non-character keys (like Shift, Esc, or Arrow keys).

Example
Try it yourself

Form Events


1) focus() Event


Fires when an element gains focus

Example
Try it yourself

2) blur() Event


Fires when an element loses focus

Example
Try it yourself

3) change() Event


Fires when the value of an element changes

Example
Try it yourself

4) submit() Event



Fires when a form is submitted

Example
Try it yourself