[spellcheck]
Example
<label for="key">API key</label>
<input id="key" name="api_key" spellcheck="off"><label for="key">API key</label>
<input id="key" name="api_key" spellcheck="false">spellcheck takes 'true' or 'false', so 'false' turns the red underlines off.
Common mistakes
- Writing
spellcheck='off', which is not a valid value. - Leaving red underlines on code editors and token fields.
Key points
- Fields for codes, emails, usernames and passwords set
spellcheck='false'. - Values are 'true' or 'false', not 'on' or 'off'.
- Long free-text fields like comments keep spell check on.
Interview questions
Is spellcheck a boolean attribute?
No. It is enumerated, so spellcheck='false' turns it off. An empty value means 'true'.
Is spellcheck the same as autocorrect?
No. Spell check only marks words. Autocorrect changes them as the user types.
Does spellcheck work on contenteditable elements?
Yes. It applies to editable text, including <textarea>, text inputs and contenteditable regions.