Easy Tutorial
❮ Met Loc Assign Prop Link Type ❯

Keygen autofocus Attribute

Keygen Object

Example

Check if the keygen field automatically gains focus when the page loads:

x Output result:


Definition and Usage

The autofocus attribute is used to set or return whether the keygen field automatically gains focus when the page loads.

This attribute is the HTML autofocus attribute.


Browser Support

All major browsers support the autofocus attribute, except Internet Explorer.

Note: The HTML autofocus attribute in the <keygen> element is not supported in Firefox.


Syntax

Return the autofocus attribute:

Set the autofocus attribute:

Attribute Values

Value Description
true false Describes whether the keygen field gains focus when the page loads. true - The keygen field gains focus<br>false - Default. The keygen field does not gain focus

Technical Description

| Return Value: | Boolean, returns true if the keygen field automatically gains focus when the page loads, otherwise returns false | | --- | --- |


Related Pages

HTML Reference: HTML <keygen> autofocus Attribute


Keygen Object

❮ Met Loc Assign Prop Link Type ❯