Javatpoint Logo
Javatpoint Logo

Mouseout event in javascript

When the mouse cursor removes the HTML element, the onmouseout event is worked and works with user-defined functionality. This function is operated on the user element. html tag and div information when the mouse cursor goes away using event. The mouseout function works with the mouseout function to disable the function. For instance, a link can be highlighted using an onmouseout event and removed links highlighted using a mouseout event through the mouse pointer link.

Syntax

The following syntaxes work in different formats with different events using javascript.

Syntax 1: the following syntax uses on the html tag and javascript function. The "onmouseout" function works with the script tag or a different script page.

Syntax 2: the following syntax works for the "onmouseout event in the javascript tag and its function. We can use the object of the html element using id or class.

Syntax 3: the following syntax uses the mouseout function with addEventListener event using javascript.

JavaScript Onmouseout Event Parameters

  • The onmouseout event accepts a single parameter. We can use the name of the function which is essential.
  • Name of the function: an onmouseout event works with the function name. The handler/function contains a user-defined operation for the mouse-out event.

JavaScript's Onmouseout Event Return Value

  • No value is returned. The Onmouseove event does not show any output data. It displays user defined web page with the functions validation.
  • We can confirm the event function with the user-defined html functions style and validation.

Support browsers

The mouse event function supports many browsers. The "mouseout" function supports the following browsers.

  • Crome
  • Edge
  • Firefox
  • Opera
  • Safari
  • IE

Examples

The following examples show the mouseout function in different ways and various events.

Example 1

The following example shows the mouseout event with the mouse-out function on the html tag and handler event.

Output

The image shows the activated mouseout event output page.

Mouseout event in javascript

Example 2

We can use element objects with mouseover and mouseout functions to change particular information containers.

Output

The image shows the activated mouseout event output page.

Mouseout event in javascript

Example 3

The mouseout events work in the example using the addEventListener event of the javascript function. We can change the random background and font color using the mouseout function, and the basic tag shows after the mouseover function.

Output

The image shows the activated mouseout event output page.

Mouseout event in javascript

Example 4

The mouseover and mouseout events work similarly for the windows of the html page in the given an example. This event works on the user-defined tags and window application.

Output

The image shows the activated mouseout event output page.

Mouseout event in javascript

Example 5

The following example shows the mouseout event without the mouseover function on the html tag and handler event. It works only when the mouse pointer is on the div and removed from the tag. After the use of the mouseout function, the style shows continuously.

Output

The image shows the activated mouseout event output page.

Mouseout event in javascript

Conclusion

The mousemat event is useful for user interaction and mouse-based functionality of the application. It is mostly used for attractive data and interactive pages.







Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA