HTML spellcheck Attribute

 

ATTENTION: THIS PAGE IS Valid HTML 5 AND IS BEST VIEWED WITH HTML 5 - Please upgrade your browser or download one of the HTML 5 compatible browsers such as Mozilla Firefox, Chrome, Opera or IE 9 (March 14, 2011 or later). For more information see HTML 5 browsers.


If you find this helpful, please click the Google +1 Button to the left, if it is white, to make it turn blue or red. Thank you! (It also helps find this page again more easily.)


PDF mobile

The spellcheck attribute in HTML

The spellcheck property determines whether or not an HTML element will be spell checked. Try entering some text with spelling errors in the following input fields.


This is a contenteditable paragraph. It should be checked for mispelled words.

This is a contenteditable paragraph. It should not be checked for mispelled words.

WebKit browsers such as Chrome and Safari will not highlight (with a dotted red underline) the misspelled words in the existing content, such as "mispelled" in the examples above. If you type in those fields, any spelling errors in new text that is entered in fields created by HTML elements with the spellcheck property set to true will be spell checked, but the text decoration of pre-existing content will not be changed.

How to code the spellcheck attribute

Make sure you understand the difference between an attribute and property and are familiar with the definitions of other HTML terms.

The spellcheck attribute is an enumerated attribute, not a boolean attribute. There are four possible ways to code the spellcheck attribute to set the spellcheck property of an element:

  1. omit the spellcheck attribute, in which case the value of the spellcheck property will be inherited
  2. spellcheck="", which sets the spellcheck property to true
  3. spellcheck="true", which sets the spellcheck property to true
  4. spellcheck="false", which sets the spellcheck property to false

All other values are not valid.


Valid HTML 5