HTML5
HTML Spell Check
spellcheck is a global HTML5 attribute that tells the browser whether it should check the spelling and grammar of editable text in an element. It is useful on form inputs, textareas, and elements with contenteditable.
The spellcheck Attribute
spellcheck is a global attribute, so it can be applied to any element, though it only has an effect on editable content. It accepts the enumerated values true and false.
| Value | Effect |
|---|---|
| true | The browser checks spelling/grammar and marks errors. |
| false | Spell checking is turned off for the element. |
Examples
<!-- Spell checking ON -->
<textarea spellcheck="true">Type your message here</textarea>
<!-- Spell checking OFF (e.g., for a code field) -->
<input type="text" spellcheck="false">
<!-- On an editable div -->
<div contenteditable="true" spellcheck="true">Edit me</div>When to Disable It
- For fields containing code, usernames, product codes, or serial numbers.
- For inputs where red squiggly underlines would distract the user.
- For addresses or names that are not real dictionary words.
ℹ️
spellcheck is only a hint. The actual spell-checking behaviour also depends on the browser and the user's own settings, so it may not always take effect.
