HTML onfocus Event Attribute
Example
Run a script when the input field gains focus:
Try it »
Browser support





All major browsers support the onfocus event attribute
Definition and Usage
The onfocus attribute is triggered when an element gains focus
Onfocus is usually used for ,
HTML Event Attributes