Knowledge baseExam Center
ENEnglish
Choose language13

CKTIS / HTML

HTML term or value: spellcheck

The `spellcheck` attribute gives the browser a hint about whether editable text should receive spelling and grammar checking.

Version: WHATWG HTML Living Standard; index snapshot date recorded separately

Syntax

<textarea spellcheck="false"></textarea>

spellcheck is enumerated, not boolean: the empty value and true request checking, while false disables it. A missing or invalid token selects the default state, which can inherit an ancestor setting and depend on the element.

Only mutable input controls in the text, search, url, or email states and mutable textarea controls are checkable; a control must be neither readonly nor disabled. Editable contenteditable content is also checkable. The dictionary derives from lang; the user agent and user preferences can override actual checking, so the IDL value need not describe whether checking really occurs.

Use spellcheck="false" for code, identifiers, or domain terms where error markings are distracting. The attribute neither validates a value nor blocks form submission; it is not a privacy or security control and must not be relied on to keep text away from a checking service.

The example reports spellcheck as false on the parent, inherited false on a field without the attribute, explicit true on the other field, and raw null for the inheriting child.

Examples

<!doctype html><meta charset="utf-8"><div id="p" spellcheck="false"><textarea id="x"></textarea></div><textarea id="y" spellcheck="true"></textarea><output id="result"></output><script>result.textContent=`parent=${p.spellcheck}; inherited=${x.spellcheck}; explicit=${y.spellcheck}; childRaw=${x.getAttribute("spellcheck")}`;</script>

Result

parent=false; inherited=false; explicit=true; childRaw=null

The executed example verifies native inheritance of disabled checking and an explicit override on a neighboring control.

Sources