THE WORLD'S LARGEST WEB DEVELOPER SITE
HTMLCSSJAVASCRIPTSQLPHPBOOTSTRAPJQUERYANGULARXML

Input Submit focus() Method

Input Submit Object Reference Input Submit Object

Example

Give focus to a submit button:

document.getElementById("mySubmit").focus();
Try it Yourself »

Definition and Usage

The focus() method is used to give focus to a submit button.

Tip: Use the blur() method to remove focus from a submit button.


Browser Support

Method
focus() Yes Yes Yes Yes Yes

Syntax

submitObject.focus()

Parameters

None.

Technical Details

Return Value: No return value

Input Submit Object Reference Input Submit Object