HTML DOM onfocus Event
The HTML DOM onfocus event occurs when an element gets focused. The onfocus event is mostly used with <input>, <select>, and <a>. The onfocus event is the opposite of the onblur event. Syntax: In HTML:<element onfocus="myScript">In JavaScript:object.onfocus = function(){myScr