Keygen autofocusProperty
Examples
Check whether the keygen field automatically gets focus when the page is loaded:
var x = document.getElementById("myKeygen").autofocus;
xThe output result is:
true
Try it Yourself »
Definition and Usage
The autofocus property is used to set or return whether the keygen field automatically gets focus when the page is loaded.
This property is the HTML autofocus attribute.
Browser Support
![]()
All major browsers support the autofocus property, except Internet Explorer.
Note:The HTML autofocus attribute of the <keygen> element is not supported in Firefox.
Syntax
Return the autofocus property:
keygenObject.autofocus
Set the autofocus property:
keygenObject.autofocus=true|false
Property Values
| Value | Description |
|---|---|
| true|false | Describes whether the keygen field gets focus when the page is loaded.
|
Technical Details
| Return Value: | A Boolean value, returns true if the keygen field automatically gets focus when the page is loaded, otherwise returns false. |
|---|
Related Pages
HTML Reference Manual:HTML <keygen> autofocus attribute
Other Extensions
Keygen Object