W3Schools.com
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

Internet Explorer Firefox Opera Google Chrome Safari

The focus() method is supported in all major browsers.


Syntax

submitObject.focus()

Parameters

None.

Technical Details

Return Value: No return value

Input Submit Object Reference Input Submit Object