Input URL focus() method

Definition and Usage

focus() The method is used to give focus to the URL field.

Tip:Usage blur() method Focus can be removed from the URL field.

Example

Set Focus on the URL Field:

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

Try It Yourself

Syntax

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