This onfocus attribute works when the element gets focused. This event attribute is mostly used with <input>, <select>, <a> elements. This event attribute is supported by all HTML elements excepts <base>, <bdo>, <br>, <head>, <html>, <iframe>, <meta>, <param>, <script>, <style>, and <title> elements.
<element onfocus = "script">
Attribute Value: The script value run when onfocus attribute called.
Supported Browsers: The browser supported by onfocus attribute are listed below:
- Apple Safari
- Google Chrome
- Internet Explorer