mozilla

Revision 49257 of HTMLElement

  • Revision slug: DOM/HTMLElement
  • Revision title: HTMLElement
  • Revision id: 49257
  • Created:
  • Creator: chriseverson
  • Is current revision? No
  • Comment 3 words added

Revision Content

{{ DomRef() }}

HTML element interface

HTMLElement is an abstract interface for the DOM from which all HTML elements inherit.

Properties

Name Type Description
{{ domxref("element.accessKey", "accessKey") }} {{ HTMLVersionInline("5") }} DOMString The access key assigned to the element.
{{ domxref("element.className", "className") }} DOMString The name of the CSS class assigned to the element.
{{ domxref("element.dir", "dir") }} DOMString The element's dir attribute.
{{ domxref("element.id", "id") }} DOMString
The element's ID.
{{ domxref("element.lang", "lang") }} DOMString The element's lang attribute.
{{ domxref("element.title", "title") }} DOMString The element's title.

Methods

Name & Arguments Return Description

{{ domxref("element.blur()", "blur()") }} {{ HTMLVersionInline("5") }}

void Removes keyboard focus from the currently focused element.
{{ domxref("element.click()", "click()") }} {{ HTMLVersionInline("5") }} void Sends a mouse click event to the element.
{{ domxref("element.focus()", "focus()") }} {{ HTMLVersionInline("5") }} void Makes the element the current keyboard focus.

Examples

Specification

Browser compatibility

{{ CompatibilityTable() }}

Feature Firefox (Gecko) Chrome Internet Explorer Opera Safari
Basic support

{{ CompatGeckoDesktop("1.0") }}

{{ CompatUnknown() }}

{{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
{{ domxref("element.accessKey", "accessKey") }}

{{ CompatGeckoDesktop("5.0") }}

{{ domxref("element.blur()", "blur()") }}

{{ CompatGeckoDesktop("5.0") }}

{{ domxref("element.click()", "click()") }}

{{ CompatGeckoDesktop("5.0") }}

{{ domxref("element.focus()", "focus()") }}

{{ CompatGeckoDesktop("5.0") }}

Feature Firefox Mobile (Gecko) Android IE Mobile Opera Mobile Safari Mobile
Basic support

{{ CompatGeckoMobile("1.0") }}

{{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }} {{ CompatUnknown() }}
{{ domxref("element.accessKey", "accessKey") }}

{{ CompatGeckoMobile("5.0") }}

No Compat.

{{ domxref("element.blur()", "blur()") }}

{{ CompatGeckoMobile("5.0") }}

{{ domxref("element.click()", "click()") }}

{{ CompatGeckoMobile("5.0") }}

{{ domxref("element.focus()", "focus()") }}

{{ CompatGeckoMobile("5.0") }}

See also

  • {{ domxref("Element") }}

Revision Source

<p>{{ DomRef() }}</p>
<h2>HTML element interface</h2>
<p><code>HTMLElement</code> is an abstract interface for the <a href="/en/DOM" title="en/DOM">DOM</a> from which all HTML elements inherit.</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>{{ domxref("element.accessKey", "accessKey") }} {{ HTMLVersionInline("5") }}</td> <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a></code></td> <td>The access key assigned to the element.</td> </tr> <tr> <td>{{ domxref("element.className", "className") }}</td> <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a></code></td> <td>The name of the CSS class assigned to the element.</td> </tr> <tr> <td>{{ domxref("element.dir", "dir") }}</td> <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a></code></td> <td>The element's <code>dir</code> attribute.</td> </tr> <tr> <td>{{ domxref("element.id", "id") }}</td> <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a><br> </code></td> <td>The element's ID.</td> </tr> <tr> <td>{{ domxref("element.lang", "lang") }}</td> <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a></code></td> <td>The element's <code>lang</code> attribute.</td> </tr> <tr> <td>{{ domxref("element.title", "title") }}</td> <td><code><a href="/En/DOM/DOMString" title="En/DOM/DOMString">DOMString</a></code></td> <td>The element's title.</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> <p>{{ domxref("element.blur()", "blur()") }} {{ HTMLVersionInline("5") }}</p> </td> <td><code>void</code></td> <td>Removes keyboard focus from the currently focused element.</td> </tr> <tr> <td>{{ domxref("element.click()", "click()") }} {{ HTMLVersionInline("5") }}</td> <td><code>void</code></td> <td>Sends a mouse click event to the element.</td> </tr> <tr> <td>{{ domxref("element.focus()", "focus()") }} {{ HTMLVersionInline("5") }}</td> <td><code>void</code></td> <td>Makes the element the current keyboard focus.</td> </tr> </tbody>
</table>
<h2>Examples</h2>
<h2>Specification</h2>
<ul> <li><a class=" external" href="http://whatwg.org/html#htmlelement">HTML5: <code>HTMLElement</code> interface</a></li>
</ul>
<h2>Browser compatibility</h2>
<p>{{ CompatibilityTable() }}</p>
<div id="compat-desktop">
<table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Firefox (Gecko)</th> <th>Chrome</th> <th>Internet Explorer</th> <th>Opera</th> <th>Safari</th> </tr> <tr> <td>Basic support</td> <td> <p>{{ CompatGeckoDesktop("1.0") }}</p> </td> <td rowspan="5"> <p>{{ CompatUnknown() }}</p> </td> <td rowspan="5">{{ CompatUnknown() }}</td> <td rowspan="5">{{ CompatUnknown() }}</td> <td rowspan="5">{{ CompatUnknown() }}</td> </tr> <tr> <td>{{ domxref("element.accessKey", "accessKey") }}</td> <td> <p>{{ CompatGeckoDesktop("5.0") }}</p> </td> </tr> <tr> <td>{{ domxref("element.blur()", "blur()") }}</td> <td> <p>{{ CompatGeckoDesktop("5.0") }}</p> </td> </tr> <tr> <td>{{ domxref("element.click()", "click()") }}</td> <td> <p>{{ CompatGeckoDesktop("5.0") }}</p> </td> </tr> <tr> <td>{{ domxref("element.focus()", "focus()") }}</td> <td> <p>{{ CompatGeckoDesktop("5.0") }}</p> </td> </tr> </tbody>
</table>
</div>
<div id="compat-mobile">
<table class="compat-table"> <tbody> <tr> <th>Feature</th> <th>Firefox Mobile (Gecko)</th> <th>Android</th> <th>IE Mobile</th> <th>Opera Mobile</th> <th>Safari Mobile</th> </tr> <tr> <td>Basic support</td> <td> <p>{{ CompatGeckoMobile("1.0") }}</p> </td> <td rowspan="5">{{ CompatUnknown() }}</td> <td rowspan="5">{{ CompatUnknown() }}</td> <td rowspan="5">{{ CompatUnknown() }}</td> <td rowspan="5">{{ CompatUnknown() }}</td> </tr> <tr> <td>{{ domxref("element.accessKey", "accessKey") }}</td> <td> <p>{{ CompatGeckoMobile("5.0") }}</p> </td> <td> <p>No Compat.</p> </td> </tr> <tr> <td>{{ domxref("element.blur()", "blur()") }}</td> <td> <p>{{ CompatGeckoMobile("5.0") }}</p> </td> </tr> <tr> <td>{{ domxref("element.click()", "click()") }}</td> <td> <p>{{ CompatGeckoMobile("5.0") }}</p> </td> </tr> <tr> <td>{{ domxref("element.focus()", "focus()") }}</td> <td> <p>{{ CompatGeckoMobile("5.0") }}</p> </td> </tr> </tbody>
</table>
</div>
<h2>See also</h2>
<ul> <li>{{ domxref("Element") }}</li>
</ul>
Revert to this revision