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 390937 of HTMLKeygenElement

  • Revision slug: DOM/HTMLKeygenElement
  • Revision title: HTMLKeygenElement
  • Revision id: 390937
  • Created:
  • Creator: teoli
  • Is current revision? No
  • Comment

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 Always false because keygen objects are never candidates for constraint validation.

Methods

Name & Arguments Return Description
checkValidity() Boolean Always returns true because keygen objects are never candidates for constraint validation.
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>
<div class="note">
  <p><strong>Note: </strong>This page describes the Keygen Element interface as specified, not as currently implemented by Gecko. See {{Bug(101019)}} for details and status.</p>
</div>
<h2 id="HTML.C2.A0Keygen_Element_Interface">HTML&nbsp;Keygen Element Interface</h2>
<p>DOM&nbsp;<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 id="Properties">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</code></td>
      <td><code><a href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean">Boolean</a></code></td>
      <td>Reflects the {{ htmlattrxref("autofocus", "keygen") }}&nbsp;HTML attribute, indicating that the form control should have input focus when the page loads.</td>
    </tr>
    <tr>
      <td><code>challenge</code></td>
      <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a></code></td>
      <td>Reflects the {{ htmlattrxref("challenge", "keygen") }} HTML&nbsp;attribute, containing a challenge string that is packaged with the submitted key.</td>
    </tr>
    <tr>
      <td><code>disabled</code></td>
      <td><code><a href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean">Boolean</a></code></td>
      <td>Reflects the {{ htmlattrxref("disabled", "keygen") }}&nbsp;HTML attribute, indicating that the control is not available for interaction.</td>
    </tr>
    <tr>
      <td><code>form</code></td>
      <td><code>readonly <a href="/en/DOM/HTMLFormElement" title="en/DOM/HTMLFormElement">HTMLFormElement</a></code></td>
      <td>Indicates the control's form owner, reflecting the {{ htmlattrxref("form", "keygen") }}&nbsp;HTML&nbsp;attribute if it is defined.</td>
    </tr>
    <tr>
      <td><code>keytype</code></td>
      <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a></code></td>
      <td>Reflects the {{ htmlattrxref("keytype", "keygen") }} HTML&nbsp;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></code></td>
      <td>A list of label elements associated with this keygen element.</td>
    </tr>
    <tr>
      <td><code>name</code></td>
      <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a></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</code></td>
      <td><code>readonly </code><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a></code></td>
      <td>Must be the value <code>keygen</code>.</td>
    </tr>
    <tr>
      <td><code>validationMessage</code></td>
      <td><code>readonly </code><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a></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</code></td>
      <td><code>readonly <a href="/en/DOM/ValidityState_Interface" title="en/DOM/ValidityState Interface">ValidityState</a></code></td>
      <td>The validity states that this element is in.</td>
    </tr>
    <tr>
      <td><code>willValidate</code></td>
      <td><code><a href="/en/JavaScript/Reference/Global_Objects/Boolean" title="en/JavaScript/Reference/Global Objects/Boolean">Boolean</a></code></td>
      <td>Always false because <code>keygen</code> objects are never candidates for constraint validation.</td>
    </tr>
  </tbody>
</table>
<h2 id="Methods">Methods</h2>
<table class="standard-table">
  <thead>
    <tr>
      <th scope="col">Name &amp;&nbsp;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>Always returns true because <code>keygen</code> objects are never candidates for constraint validation.</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>
<p>&nbsp;</p>
Revert to this revision