Easy Tutorial
❮ Angularjs Services Angularjs Modules ❯

AngularJS ng-focus Directive

AngularJS Reference Manual


AngularJS Example

Execute an expression when the input field gets focus:


Definition and Usage

The ng-focus directive tells AngularJS what to do when an HTML element gets focus.

The ng-focus directive does not override the element's original onfocus event, both will be executed.


Syntax

<a>, <input>, <select>, <textarea>, and window objects support this directive.


Parameter Values

Value Description
expression The expression to execute when the element gets focus.

AngularJS Reference Manual

❮ Angularjs Services Angularjs Modules ❯