Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML keygen autofocus Attribute

HTML autofocus attribute

HTML keygen Tag Reference HTML tag

Example

Make the "Encryption" field automatically focused 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

Supported by Opera, Chrome, and Safari 6 autofocus attribute of the tag.


Definition and Usage

The autofocus attribute is a boolean attribute.

The autofocus attribute specifies that when the page loads, the element is automatically focused.


Differences between HTML 4.01 and HTML5

The tag is new in HTML5.


Differences between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the autofocus attribute must be defined as .


Syntax


HTML keygen Tag Reference HTML tag