DOM Interfaces
HTMLElement
Base interface for HTML elements; extends Element and supplies HTML-specific focus, editing, dataset and visibility behavior. Many HTML tags share this interface without defining a dedicated subtype. Obtain instances through DOM selection or creation rather than calling new HTMLElement(). Example result: true.
Formal Syntax & Structure
html syntaxhtml
const element = document.getElementById('demo'); // HTMLElementReturn Value
HTMLElement
An existing HTML DOM object associated with the p element in this example; this interface is a type, not a function return contract.
Working Example
Example Snippethtml
<p id="demo">Hello</p><p> Result: <output id="result"></output></p><script> const e = document.getElementById('demo'); const result = value => { document.getElementById("result").textContent = String(value); }; result(e instanceof HTMLElement);</script>Browser Compatibility
Minimum supported versions across modern rendering engines
Chrome
1
Yes
Edge
12
Yes
Firefox
1
Yes
Safari
1
Yes
Opera
8
Yes
Checked desktop BCD snapshot: HTMLElement interface, not every member. Versions denote the recorded start of support (≤ means at least that early), not a guarantee of all behavior. Unresolved mirror and preview rows omitted.
HTML Living Standard