English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
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.
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 ‹/›
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.
The autofocus attribute is a boolean (boolean) attribute.
The autofocus attribute specifies that the button should automatically receive focus when the page is loaded.
The autofocus attribute is a difference between HTML5New attributes in the <button> tag.
In XHTML, attribute abbreviations are not allowed, the autofocus attribute must be defined as <button autofocus="autofocus">.
<button type="button" autofocus>