spellchecker

The spellcheck attribute in HTML determines if the browser should check the spelling of the content in an input field, enhancing text accuracy and the overall user experience.

spellcheck attribute

The spellcheck global attributes indicates whether the element is eligible for spell checking. This is an enumerated attribute that allows you to control the spell-checking behavior of the element.

Syntax

index.html
<element spellcheck="true|false">

Example

This is a praggagraph. It is editable. Try to change the text.

First name:
index.html
<p contenteditable="true" spellcheck="true">This is a praggagraph. It is editable. Try to change the text.</p>
First name: <input type="text" name="fname" spellcheck="true">

Applicable to

The spellcheck attribute is a Global Attribute and can be applied to any HTML element.

ElementsAttribute
All HTML elementsspellcheck

Values

  • true: Activates spell checking for the element.
  • false: Deactivates spell checking for the element.

See also

Conclusion

The spellcheck attribute in HTML controls whether the browser should check the spelling of the content within an element. By setting it to true, it enables spell-checking, improving text accuracy, while setting it to false disables the feature. It is applicable to all HTML elements, especially form fields and editable content.