Please note, this is a STATIC archive of website developer.mozilla.org from 03 Nov 2016, cach3.com does not collect or store any user information, there is no "phishing" involved.

Revision 108385 of HTMLKeygenElement

  • Revision slug: DOM/HTMLKeygenElement
  • Revision title: HTMLKeygenElement
  • Revision id: 108385
  • Created:
  • Creator: jswisher
  • Is current revision? No
  • Comment 1 words added, 2 words removed

Revision Content

{{ DomRef() }}

{{ HTMLVersionHeader("5") }}

{{ note("This page describes the Keygen Element interface as specified, not as currently implemented by Gecko. See " .. Bug(101019) .. " for details and status.") }}

HTML Keygen Element Interface

DOM keygen elements expose the HTMLKeygenElement interface, which provides special properties and methods (beyond the regular element object interface they also have available to them by inheritance) for manipulating the layout and presentation of keygen elements.

Properties

Name Type Description
autofocus
Boolean
Reflects the {{ htmlattrxref("autofocus", "keygen") }} HTML attribute, indicating that the form control should have input focus when the page loads.
challenge
DOMString
Reflects the {{ htmlattrxref("challenge", "keygen") }} HTML attribute, containing a challenge string that is packaged with the submitted key.
disabled
Boolean
Reflects the {{ htmlattrxref("disabled", "keygen") }} HTML attribute, indicating that the control is not available for interaction.
form
readonly HTMLFormElement
Indicates the control's form owner, reflecting the {{ htmlattrxref("form", "keygen") }} HTML attribute if it is defined.
keytype
DOMString
Reflects the {{ htmlattrxref("keytype", "keygen") }} HTML attribute, containing the type of key used.
labels {{ unimplemented_inline("556743") }} readonly NodeList
A list of label elements associated with this keygen element.
name
DOMString
Reflects the {{ htmlattrxref("name", "keygen") }} HTML attribute, containing the name for the control that is submitted with form data.
type
readonly DOMString
Must be the value keygen.
validationMessage
readonly DOMString
A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (willValidate is false), or it satisfies its constraints.
validity
readonly ValidityState
The validity states that this element is in.
willValidate
Boolean
Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.

Methods

Name & Arguments Return Description
checkValidity() Boolean Returns false if the control is a candidate for constraint validation, and it does not satisfy its constraints. In this case, it also fires an invalid event at the control. It returns true if the control is not a candidate for constraint validation, or if it satisfies its constraints.
setCustomValidity(in DOMString error) void Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.

Revision Source

<p>{{ DomRef() }}</p>
<p>{{ HTMLVersionHeader("5") }}</p>
<p>{{ note("This page describes the Keygen Element interface as specified, not as currently implemented by Gecko. See " .. Bug(101019) .. " for details and status.") }}<span id="summary_alias_container"><span id="short_desc_nonedit_display"><br>
</span></span></p>
<h2>HTML Keygen Element Interface</h2>
<p>DOM <code>keygen</code> elements expose the <a class=" external" href="https://dev.w3.org/html5/spec/the-button-element.html#htmlkeygenelement" title="https://dev.w3.org/html5/spec/the-button-element.html#htmlkeygenelement">HTMLKeygenElement</a> interface, which provides special properties and methods (beyond the regular <a href="../../../../en/DOM/element" rel="internal">element</a> object interface they also have available to them by inheritance) for manipulating the layout and presentation of <code>keygen</code> elements.</p>
<h2>Properties</h2>
<table class="standard-table"> <thead> <tr> <th scope="col">Name</th> <th scope="col">Type</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>autofocus<br> </code></td> <td><code><a href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean">Boolean</a><br> </code></td> <td>Reflects the {{ htmlattrxref("autofocus", "keygen") }} HTML attribute, indicating that the form control should have input focus when the page loads.</td> </tr> <tr> <td><code>challenge<br> </code></td> <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a><br> </code></td> <td>Reflects the {{ htmlattrxref("challenge", "keygen") }} HTML attribute, containing a challenge string that is packaged with the submitted key.</td> </tr> <tr> <td><code>disabled<br> </code></td> <td><code><a href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean">Boolean</a><br> </code></td> <td>Reflects the {{ htmlattrxref("disabled", "keygen") }} HTML attribute, indicating that the control is not available for interaction.</td> </tr> <tr> <td><code>form<br> </code></td> <td><code>readonly <a href="/en/DOM/HTMLFormElement" title="en/DOM/HTMLFormElement">HTMLFormElement</a><br> </code></td> <td>Indicates the control's form owner, reflecting the {{ htmlattrxref("form", "keygen") }} HTML attribute if it is defined.</td> </tr> <tr> <td><code>keytype<br> </code></td> <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a><br> </code></td> <td>Reflects the {{ htmlattrxref("keytype", "keygen") }} HTML attribute, containing the type of key used.</td> </tr> <tr> <td><code>labels </code>{{ unimplemented_inline("556743") }}</td> <td><code>readonly <a href="/En/DOM/NodeList" title="En/DOM/NodeList">NodeList</a><br> </code></td> <td>A list of label elements associated with this keygen element.</td> </tr> <tr> <td><code>name<br> </code></td> <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a><br> </code></td> <td>Reflects the {{ htmlattrxref("name", "keygen") }} HTML attribute, containing the name for the control that is submitted with form data.</td> </tr> <tr> <td><code>type<br> </code></td> <td><code>readonly </code><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a><br> </code></td> <td>Must be the value <code>keygen</code>.</td> </tr> <tr> <td><code>validationMessage<br> </code></td> <td><code>readonly </code><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a><br> </code></td> <td>A localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (<strong>willValidate</strong> is false), or it satisfies its constraints.</td> </tr> <tr> <td><code>validity<br> </code></td> <td><code>readonly <a href="/en/DOM/ValidityState_Interface" title="en/DOM/ValidityState Interface">ValidityState</a><br> </code></td> <td>The validity states that this element is in.</td> </tr> <tr> <td><code>willValidate<br> </code></td> <td><code><a href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean">Boolean</a><br> </code></td> <td>Indicates whether the element is a candidate for constraint validation. It is false if any conditions bar it from constraint validation.</td> </tr> </tbody>
</table>
<h2>Methods</h2>
<table class="standard-table"> <thead> <tr> <th scope="col">Name &amp; Arguments</th> <th scope="col">Return</th> <th scope="col">Description</th> </tr> </thead> <tbody> <tr> <td><code>checkValidity()</code></td> <td><code><a href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean">Boolean</a></code></td> <td>Returns false if the control is a candidate for constraint validation, and it does not satisfy its constraints. In this case, it also fires an <code>invalid</code> event at the control. It returns true if the control is not a candidate for constraint validation, or if it satisfies its constraints.</td> </tr> <tr> <td><code>setCustomValidity(in DOMString error)</code></td> <td><code>void</code></td> <td>Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.</td> </tr> </tbody>
</table>
Revert to this revision