VOOZH about

URL: https://www.geeksforgeeks.org/html/html-select-autofocus-attribute/

⇱ HTML <select> autofocus Attribute - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

HTML <select> autofocus Attribute

Last Updated : 26 May, 2026

The autofocus attribute is used to automatically focus on a <select> element when the webpage loads. It helps users interact with the dropdown menu quickly.

  • Automatically places the cursor focus on the <select> element when the page opens.
  • Improves user experience by reducing extra clicks.
  • It is a boolean attribute, so its presence alone enables autofocus.

Syntax:

<select autofocus>

Example: This example shows the autofocus attribute on a <select> element. The dropdown automatically receives focus when the page loads, allowing users to interact with it without clicking.

Comment
Article Tags: