VOOZH about

URL: https://www.geeksforgeeks.org/angular-js/angularjs-ng-mouseleave-directive/

⇱ AngularJS ng-mouseleave Directive - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AngularJS ng-mouseleave Directive

Last Updated : 31 Jul, 2024

The ng-mouseleave directive in AngularJS is used to apply custom behavior when a mouse-leave event occurs on a specific HTML element. It can be used to show a popup alert when the mouse leaves a specific position in an HTML element. It is supported by all HTML elements.

Syntax:

<element ng-mouseleave="expression"> 
content ...
</element>

Parameter:

  • expression: When the mouse cursor leaves an element, then this expression will execute.

Example 1: This example describes the ng-mouseleave Directive in AngularJS.

Output:

👁 Image

Example 2: This example describes the ng-mouseleave Directive in AngularJS, by specifying the <input> tag that has the ng-mouseleave directive containing the alert() function which helps to display the data in the alert message.

Output:


Comment

Explore