Disclosure: Your support helps keep the site running! We earn a referral fee for some of the services we recommend on this page. Learn more
- Attribute of
- The Role Of In HTML Forms (To Create Drop-Down Lists)
- What does
- Triggers an event when a select item receives focus.
Event Handling With the Select Element
onFocus attribute of
<select> lets you dynamically change something on screen when it gets focus. For example, we could change the color of a form field when the user clicks on it.
Browser Support for onFocus