Input Text focus() method
Example
Set the focus to a text field:
document.getElementById("myText").focus();
Try it »
Definition and Usage
The focus() method is used to set the focus to a text field.
Tip: Use blur() The method removes the focus from the text field.
Browser support

All major browsers support the focus() method.
Syntax
textObject
.focus()
Parameters
| None. |
|---|
Technical details
| Return Value: | No return value |
|---|
The Input Text object