Search.../

focus( )

Places focus on the element.

Description

The focus() function places focus on the element and fires a focus event.

The focus event handlers set on this element by the onFocus( ) function or in the Editor are called.

Receiving focus through a call to this function is equivalent to a user clicking on or tabbing to the element manually.

Syntax

function focus(): void

focus Parameters

This function does not take any parameters.

Returns

This function does not return anything.

Return Type:

void
Mixed in from:$w.FocusMixin

Related Content:

Was this helpful?

Place focus on an element

Code Example

Copy Code
1$w("#myElement").focus();