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.

ValueEffect
trueThe browser checks spelling/grammar and marks errors.
falseSpell checking is turned off for the element.

Examples

Enabling and disabling spell check
<!-- 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.

Ready to use your HTML skills?

Find web development internships and fresher jobs across India.

Browse Web Dev Internships