HTMLElement
The base interface for every HTML element. A tag with no more specific interface below is a plain HTMLElement. Extends Element.
Reflected properties
All setters are guarded and throw NoModificationAllowedError on a read-only document.
| Property | Attribute | Type | Notes |
|---|---|---|---|
dir |
dir |
enum | Keywords: ltr · rtl · auto. Missing or invalid → "". |
inputMode |
inputmode |
enum | Keywords: none · text · tel · url · email · numeric · decimal · search. Missing or invalid → "". |
enterKeyHint |
enterkeyhint |
enum | Keywords: enter · done · go · next · previous · search · send. Missing or invalid → "". |
autocapitalize |
autocapitalize |
enum | Keywords: "" · off · none · on · sentences · words · characters. off→none and on→sentences are synonyms; missing or present-empty → ""; any other invalid value → "sentences" (the WHATWG Sentences default, matching Chrome). |
contentEditable |
contenteditable |
string, read/write (bespoke accessor) | Getter returns "true" / "false" / "plaintext-only" / "inherit" (missing or invalid → "inherit", present-empty → "true"). Setter accepts only those four keywords case-insensitively — "inherit" removes the attribute, any other value throws SyntaxError. |
isContentEditable |
(computed) | boolean, read-only | Walks ancestors: the nearest ancestor (inclusive) with a defined contentEditable state of true/plaintext-only → editable; false → not editable; none found → false. |
See also
- Element —
getAttribute/setAttribute, content,classList, traversal, insertion - JavaScript DOM API — the interface hierarchy and
instanceof