The spellcheck attribute
The spellcheck
attribute tells the browser whether to check the spelling of the entered text. Applies to input
or textarea
tags, and to elements that have the contenteditable
attribute set.
The value true
enables the check, and false
disables it. Instead of true
, you can specify an empty value or not write it at all.
Example
Let's look at the text that contains errors and enable spell checking. If your browser supports the spellcheck
attribute and spell checking is enabled, then when the focus (!) element is received, the browser should highlight the misspelled words:
<textarea lang="en" spellcheck>This text has eror</textarea>
textarea {
width: 200px;
height: 100px;
}
:
See also
-
attribute
contenteditable
,
which allows you to edit text -
property
text-decoration-style
,
which allows you to emphasize with a wavy line