Input Search focus() methode

Definitie en gebruik

focus() Deze methode wordt gebruikt om de focus toe te wijzen aan het zoekveld.

Waarschuwing:gebruik blur() The method can remove focus from the search field.

Example

Set focus on the search field:

document.getElementById("mySearch").focus();

Try it yourself

Syntax

searchObject.focus()

Parameters

None.

Technical details

Return value:

No return value.

Browser support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support