Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

onfocus event

onfocus event

Event Object Reference Event Object

Example

Execute a piece of JavaScript code when the input box gets focus:

Try it »


Definition and Usage

The onfocus event occurs when an object gains focus.

Onfocus is usually used for ,