![]() |
VOOZH | about |
The ng-blur Directive in AngularJS is fired when an HTML element loses their focus. It doesn't override with element's original onblur event i.e. both the ng-blur expression and original onblur event will execute.
Syntax:
<element ng-blur="expression"> Contents... </element>
Parameter:
Note: The ng-blur directive is supported by <input>, <a>, <select> and <textarea>.
Example 1: This example displays the text message "Enter your text here" when the input is focused and hides it when the input focus loses.
Output:
Example 2: This example counts the number of times focus is removed from the textarea.
Output: