HTMLElement Reference

Interfaces, Properties and Methods

The parser picks an interface for each tag (the prototype chain is drawn in The Interface Hierarchy). Valid custom element names get plain HTMLElement until defined (Defining Custom HTML Elements); unknown names get HTMLUnknownElement.

The interface the parser chooses for each tagJavaScript
for (const tag of ['input', 'video', 'user-card', 'blink']) {
  console.log(`<${tag}>`.padEnd(12), document.createElement(tag).constructor.name);
}
Output
<input>      HTMLInputElement
<video>      HTMLVideoElement
<user-card>  HTMLElement
<blink>      HTMLUnknownElement
Members every HTML element inherits from HTMLElement
Member of HTMLElement What it does
hidden, inert Hide the element; block focus and clicks inside it
dataset data-user-id becomes dataset.userId
innerText Text as rendered, honoring CSS and hidden content
focus(), blur(), click() Move focus; simulate activation (Simulating Clicks)
showPopover(), togglePopover() Control a popover element (Popover and Dialog in JS)

innerText can force a reflow (Reflow, Repaint and Batching), so prefer textContent. inert is Baseline widely available since April 2023. Most properties reflect an attribute; value is the exception, holding the live value while defaultValue maps to the attribute.