English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Referenzhandbuch

Vollständiges Verzeichnis der HTML-Tags

HTML: <button> autofocus-Eigenschaft

Die autofocus-Eigenschaft ist eine boolesche Eigenschaft. Wenn sie vorhanden ist, wird sie angeben, dass der Button bei der Seite laden automatisch den Fokus erhält.

 HTML <button> Tag

Online-Beispiel

Verwenden Sie den Button mit der autofocus-Eigenschaft:

<!DOCTYPE html>
<html>
<head>
<title>HTML: <button> autofocus-Eigenschaft - Grundlagen-Tutorial-Website oldtoolbag.com</title>
<body>
<button type="button" autofocus onclick="alert('Hallo Welt!')">Klicken Sie auf mich!/button>
</body>
</html>
Test and see ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Internet Explorer 10, Firefox, Chrome, and Safari support the autofocus attribute.

Note: Internet Explorer 9 and earlier IE versions do not support the autofocus attribute.

Definition and Usage

The autofocus attribute is a boolean (boolean) attribute.

The autofocus attribute specifies that the button should automatically receive focus when the page is loaded.

HTML 4.01 HTML5and

The autofocus attribute is a difference between HTML5New attributes in the <button> tag.

Differences between HTML and XHTML

In XHTML, attribute abbreviations are not allowed, the autofocus attribute must be defined as <button autofocus="autofocus">.

Syntax

<button type="button" autofocus>

 HTML <button> Tag