HTML <keygen> disabledAttribute

HTML keygen 标签参考手册HTML <keygen> Tag

Examples

A disabled <keygen> element:

<form action="demo_keygen.html" method="get">
  Username: <input type="text" name="usr_name">
  Encryption: <keygen name="security" disabled>
  <input type="submit">
</form>

Try it yourself »

Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

Firefox, Opera, Chrome, and Safari 6 support the disabled attribute of the <keygen> tag.


Definition and Usage

The disabled attribute is a boolean attribute.

The disabled attribute specifies that the <keygen> element should be disabled. A disabled field is unusable and uneditable.

The disabled attribute can be set to restrict the user's ability to use the field until certain conditions are met (such as selecting a checkbox, etc.). Then, JavaScript can be used to remove the disabled value to make the field available again.


Differences between HTML 4.01 and HTML5

The <keygen> tag is new in HTML5.


Differences between HTML and XHTML

In XHTML, attribute minimization is forbidden, and the disabled attribute must be defined as <keygen disabled="disabled" />.


Syntax

<keygen disabled>


HTML keygen 标签参考手册HTML <keygen> Tag Other extensions