Give focus to an <a> element:
More "Try it Yourself" examples below.
The focus() method is used to give focus to an element (if it can be focused).
Tip: Use the blur() method to remove focus from an element.
|Return Value:||No return value|
Give focus to a text field:
Give focus to a text field, immediately after the document window has been loaded:
HTML DOM reference: onfocus event