How to Toggle Spell Checker on HTML Input Fields?

Learn how to disable/enable spellchecker on HTML input fields

As per the W3 spec, you can use the spellcheck attribute on HTML input fields (such as <input> and <textarea>) to toggle browser's built-in spell checker on or off. It has the following values:

  • spellcheck="true" or spellcheck — enables spell checker;
  • spellcheck="false" — disables spell checker.

For example, to disable spell checking you would set the spellcheck attribute to false like so:

<input type="text" spellcheck="false" />
<textarea spellcheck="false"></textarea>

To enable spell checking you would either set the spellcheck attribute to true or omit the value, for example, like so:

<input type="text" spellcheck />
<textarea spellcheck></textarea>
<input type="text" spellcheck="true" />
<textarea spellcheck="true"></textarea>

Hope you found this post useful. It was published . Please show your love and support by sharing this post.