Input Text focus() Methode

Definitie en gebruik

focus() Deze methode wordt gebruikt om de focus te geven aan een tekstveld.

Waarschuwing:Gebruik blur() Methode Focus can be removed from the text field.

Example

Place focus on the text field:

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

Try it yourself

Syntax

textObject.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