Keygen disabled property
Example
Check whether the keygen field is available:
var x = document.getElementById("myKeygen").disabled;
x The output result is:
true
Try it »
Definition and Usage
The disabled property sets or returns whether the keygen field is available.
A disabled element cannot be used or clicked. A disabled element is displayed in gray by default in the browser.
This property reflects the function of the HTML disabled attribute.
Browser support

All major browsers support the disabled property, except Internet Explorer.
Syntax
Return the disabled attribute:
keygenObject
.disabled
Set the disabled attribute:
keygenObject
.disabled=true|false
Attribute values
| Value | Description |
|---|---|
| true|false | Describes whether the keygen field is available
|
Technical description
| Return value: | Boolean value, returns true if the keygen field is disabled, otherwise returns false |
|---|
More examples
Example
Disable a keygen field:
document.getElementById("myKeygen").disabled=true;
The output result is:
Try it »
Example
Disable and enable the keygen field:
function disableKey()
{
document.getElementById("myKeygen").disabled=true;
}
function undisableKey()
{
document.getElementById("myKeygen").disabled=false;
}
Try it »
Related pages
HTML Reference Manual: HTML
Keygen Object