English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The keygen autofocus attribute is a boolean attribute, the autofocus attribute specifies that when the page is loaded, the <keygen> element will automatically focus.
Make the "Encryption" field automatically focused when the page is loaded:
<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>基础教程网(oldtoolbag.com)</title> </head> <body> <form action="demo-frame.php" method="get"> Username: <input type="text" name="usr_name"> Encryption: <keygen name="security" autofocus> <input type="submit"> </form> </body> </html>Teste e veja ‹/›
IEFirefoxOperaChromeSafari
Opera, Chrome e Safari 6 Suporte à propriedade autofocus da etiqueta <keygen>.
A propriedade autofocus é um atributo booleano.
A propriedade autofocus define que o elemento <keygen> ganha o foco automaticamente ao carregar a página.
<keygen> é uma etiqueta do HTML5 com novas etiquetas.
No XHTML, é proibida a abreviação de atributos, a propriedade autofocus deve ser definida como <keygen autofocus="autofocus" />。
<keygen autofocus>HTML <keygen> etiqueta