We're looking for a person or people to help audit MDN to find places we could speed up. Is this you or someone you know? Check out the RFP: https://mzl.la/2IHcMiE


この翻訳は不完全です。英語から この記事を翻訳 してください。

The HTMLSelectElement.autofocus property is a Boolean that reflects the autofocus HTML attribute, which indicates whether the associated <select> element  will get input focus when the page loads, unless the user overrides it.

Only one form-associated element in a document can have this attribute specified. If there are several, the first element with the attribute set inserted, usually the first such element on the page, get the initial focus.

Setting this property doesn't set the focus to the associated <select> element: it merely tells the browser to focus to it when the element is inserted in the document. Setting it after the insertion, that is most of the time after the document load, has no visible effect.


aBool = aSelectElement.autofocus; // Get the value of autofocus
aSelectElement.autofocus = aBool; // Set the value of autofocus



<select id="mySelect" autofocus>
  <option>Option 1</option>
  <option>Option 2</option>


// Check if the autofocus attribute on the <select>
var hasAutofocus = document.getElementById('mySelect').autofocus;


Specification Status Comment
HTML Living Standard
HTMLSelectElement の定義
現行の標準 No change since the latest snapshot, HTML5.
HTMLSelectElement の定義
勧告 Initial definition, snapshot of HTML Living Standard.

Browser compatibility

We're converting our compatibility data into a machine-readable JSON format. This compatibility table still uses the old format, because we haven't yet converted the data it contains. Find out how you can help!

Feature Chrome Edge Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
Basic support (有) (有) (有) 10 (有) (有)
Feature Android Chrome Edge Firefox Mobile (Gecko) Firefox OS IE Phone Opera Mobile Safari Mobile
Basic support (有) (有) (有) (有) (有) ? Not supported Not supported


 このページの貢献者: 8845musign
 最終更新者: 8845musign,