jQuery Mouse Events

tutorial and example
tutorial and example

When the users move the mouse pointer or click some element then the mouse event fires. To handle the mouse events here are some jQuery methods:

1) The click() Method

An event handler function is attached to an HTML element by the click() method and that function executes whenever the user click on the HTML element.

Syntax:

Example:

Try Now

2) The dblclick() Method

An event handler function is attached to an HTML element by the dblclick() method and that function executes whenever the user double-clicks on the HTML element.

Syntax:

Example:

Try Now

3) The mouseenter method

An event handler function is attached to an html element by the mouseenter() method and that function executes whenever the mouse pointer enters the HTML element.

Syntax:

Example:

Try Now

4) The mouseleave() Method

An event handler function is attached to an HTML element by the mouseleave() method and that function executes whenever the pointer of mouse leaves the html element.

Syntax:

Example:

Try Now