Javatpoint Logo
Javatpoint Logo

AngularJS ng-focus Directive

The AngularJS ng-focus directive specifies the custom behavior on focus event. It tells AngularJS what to do when an HTML element gets focus. It doesn't override the element's original onfocus event, both will be executed.

It is supported by HTML elements like < a >, < input >, < select >, < textarea >, and the window object.


Parameter explanation:

expression: It specifies an expression that is executed when an element gets focus.

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

See this example:

Test it Now

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA