<select onFocus=””>

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

Sharing is caring!

Attribute of
The Role Of In HTML Forms (To Create Drop-Down Lists)
What does <select onFocus=""> do?
Triggers an event when a select item receives focus.

Event Handling With the Select Element

The 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.

Claire is seasoned technical writer, editor, and HTML enthusiast. She writes for HTML.com and runs a content agency, Red Robot Media.

Browser Support for onFocus

AllAllAllAllAllAll