Javatpoint Logo
Javatpoint Logo

AngularJS ng-keypress Directive

The AngularJS ng-keypress directive specifies the custom behavior of AngularJS when you press any on the keyboard for a specific HTML element.

Following is the order of a key stroke:

  • Keydown
  • Keypress
  • Keyup

It is supported by <input>, <select>, <textarea>, and other editable elements.

Syntax:

Parameter explanation:

expression: It specifies an expression that is executed when a key is pressed on the keyboard.

Let's take an example to demonstrate ng-keypress directive.

See this example:

Test it Now




Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA