javascript onfocus Description
onfocus | Firefox/Netscape/NN 2 IE 3 Chrome/Safari/DOM 2 |
Bubbles: No; Cancelable: No | |
Fires when the current element receives focus due to user action (clicking or tabbing) or invoking of the focus( ) method. The onblur event of the next previously focused element fires before the onfocus event in the current element. |
|
Although the onfocus event has been supported for form controls and window objects since the early days of scriptable browsers, modern browsers can fire the event on virtually any other rendered element, provided the tabindex attribute is set for the element. Note that IE for Windows is known to omit firing the onfocus event on window objects. |
|
Typical Targets | |
For all browsers, input (of type text and password), textarea, select, and window objects; for IE 5 or later and Netscape 6, add any rendered element for which the tabindex attribute is assigned a value. |
Powered by Linode.