![]() |
VOOZH | about |
The ng-mousedown Directive in AngularJS is used to apply custom behavior when mousedown event occurs on a specific HTML element. It can be used to show a popup alert when the mouse button is pressed down. It is supported by all HTML elements.
Syntax:
<element ng-mousedown="expression"> Contents... </element>
Parameter:
Example 1: This example uses ng-mousedown Directive to set the style of an element after clicking the mouse.
Output:
Example 2: This example uses the ng-mousedown Directive to display an alert message after clicking the input area.
Output: