onFocus( )


Adds an event handler that runs when the element receives focus.

An element receives focus through user actions, such as clicking and tabbing, or programmatically, using the focus( ) function.

Note: onFocus() has no effect when applied to RadioButtonGroup elements.

Method Declaration
Copy
Method Parameters
handlerfunctionRequired

handler(event: Event): void The name of the function or the function expression to run when the element receives focus.

Returns
Return Type:Element
Did this help?