Latest web development tutorials

HTML-Eingabeautofokus-Attribut

HTML-Eingabe Tag Referenz HTML <input> -Tag

Beispiele

Die Einstellung "Vorname" Eingabefeld erhalten automatisch den Fokus, wenn die Seite geladen wird:

<form action="demo_form.html">
First name: <input type="text" name="fname" autofocus><br>
Last name: <input type="text" name="lname"><br>
<input type="submit">
</form>

Versuchen »

Browser-Unterstützung

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Internet Explorer 10, Firefox, Opera, Chrome und Safari Unterstützung Autofokus-Attribut.

Hinweis: 9 und früheren Versionen von Internet Explorer nicht unterstützt Autofokus - Attribut <input> -Tag.


Definition und Verwendung

Autofokus-Attribut ist ein Boolean-Attribut.

Autofokus-Attribut gibt, wenn die Seite geladen wird <input> Element automatisch scharf eingestellt werden soll.


Die Unterschiede zwischen den HTML 4.01 und HTML5

Autofokus-Attribut ist neu in HTML5 Attribute.


Die Unterschiede zwischen HTML und XHTML

In XHTML-Attribut Minimierung, Autofokus Attribut verbieten muss definiert werden als <input Autofokus = "Autofokus" />.


Grammatik

<input autofocus>


HTML-Eingabe Tag Referenz HTML <input> -Tag