VOOZH about

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

⇱ AngularJS ng-mouseenter Directive - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AngularJS ng-mouseenter Directive

Last Updated : 1 Aug, 2024

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

Syntax:

<element ng-mouseenter="expression"> 
Content ...
</element>

Parameter value:

  • expression: The expression will execute only when the mouse cursor enters the specific region of an element.

Example 1: This example describes the use of the ng-mouseenter Directive in AngularJS by counting the number of times the mouse enters the specific area of an element.

Output:

Example 2: This example describes the use of the ng-mouseenter Directive in AngularJS by displaying the alert message by entering into the input element's region.

Output:

Comment

Explore