Latest web development tutorials

HTML keygen autofocus attribute

Tag Reference HTML keygen HTML <keygen> tag

Examples

Let "Encryption" field automatically get the focus when the page loads:

<form action="demo_keygen.html" method="get">
Username: <input type="text" name="usr_name">
Encryption: <keygen name="security" autofocus>
<input type="submit">
</form>

try it"

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

autofocus attribute Opera, Chrome and Safari 6 Support <keygen> tag.


Definition and Usage

autofocus attribute is a Boolean attribute.

autofocus attribute specifies when the page loads, <keygen> element will automatically receive focus.


Differences between HTML 4.01 and HTML5

<Keygen> tag is new in HTML5 tags.


Differences between HTML and XHTML

In XHTML, prohibit attribute minimization, autofocus attribute must be defined as <keygen autofocus = "autofocus" />.


grammar

<keygen autofocus>


Tag Reference HTML keygen HTML <keygen> tag