VOOZH about

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

⇱ AngularJS ng-keyup Directive - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AngularJS ng-keyup Directive

Last Updated : 11 Jul, 2025

The ng-keyup Directive in AngluarJS is used to apply custom behavior on a keyup event. It is supported by <input>, <select> and <textarea> elements.

Syntax:  

<element ng-keyup="expression"> Contents... </element>

Parameter:

  • expression: When a keypress is finished, then the followed expression will be executed.

Example 1: This example uses ng-keyup Directive to change the background color when key up and down the button.  

Output: 

👁 Image
 

Example 2: This example uses the ng-keyup Directive to change the font-color, font-family & font-size when key up and down the button.  

Output:

👁 Image
 
Comment

Explore