![]() |
VOOZH | about |
The ng-keydown Directive in AngluarJS is used to apply custom behavior on a keydown event. This directive will not be overridden by the element's original onkeydown event. Both the onkeydown event & the ng-keydown Directive will be executed. It is supported by <input>, <select> and <textarea> elements.
Syntax:
<element ng-keydown="expression"> Contents... </element>
Parameter:
Example: This example uses the ng-keydown Directive to change the background color after pressing the button.
Output:
Example 2: This example uses the ng-keydown Directive to change the font-size when the key down button is pressed.
Output: