English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
Die autofocus-Eigenschaft des <select>-Elements ist eine boolesche Eigenschaft. Wenn sie vorhanden ist, wird angegeben, dass die Dropdown-Liste beim Laden der Seite automatisch in den Fokus gelangen soll.
Dropdown-Liste mit automatischer Ausrichtung:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>HTML:<select> autofocus Eigenschaft-基础教程(oldtoolbag.com)</title> </head> <body> <select autofocus> <option value="php">PHP</option> <option value="java">Java</option> <option value="rust">Rust</option> <option value="pythone">Python</option> </select> </body> </html>Test to see ‹/›
IEFirefoxOperaChromeSafari
Internet Explorer 10, Opera, Chrome, and Safari support the autofocus attribute.
Note:Firefox or Internet Explorer 9 and earlier versions do not support the autofocus attribute of the <select> tag.
The autofocus attribute is a boolean attribute.
The autofocus attribute specifies that the dropdown list automatically receives focus when the page is loaded.
The autofocus attribute is in HTML5 New attributes of the <select> tag.
In XHTML, attribute shorthand is prohibited, and the autofocus attribute must be defined as <select autofocus="autofocus">.
<select autofocus>HTML <select> Tag