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.

You can also define an event handler using the Properties and Events panel.

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

Method Declaration
Copy
Method Parameters
handlerfunctionRequired

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

Returns
Return Type:Element
Was this helpful?
Yes
No