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

Keygen disabled property

Keygen disabled property

Keygen Object Reference Keygen Object

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

Internet Explorer Firefox Opera Google Chrome Safari

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
  • true - the text field is disabled
  • false - default. The text 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 disabled attribute


    Keygen Object Reference Keygen Object