English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The keygen autofocus attribute is a boolean attribute; the autofocus attribute specifies that the <keygen> element will automatically gain focus when the page is loaded.
Let the "Encryption" field automatically gain focus 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>Test and see ‹/›
IEFirefoxOperaChromeSafari
Opera, Chrome, and Safari 6 Browsers that support the autofocus attribute of the <keygen> tag
The autofocus attribute is a boolean attribute.
The autofocus attribute specifies that the <keygen> element will automatically receive focus when the page is loaded.
<keygen> tag is HTML5 new tags.
In XHTML, attribute shorthand is prohibited, the autofocus attribute must be defined as <keygen autofocus="autofocus" />。
<keygen autofocus>HTML <keygen> tag