Hello! We are not all sinless when it comes to spelling. The reasons for this may be illiteracy or simple inattention. To help the grief of the writers, a spell check mode for the input text was introduced. Using the spellcheck attribute, we can turn this mode on and off. So let’s go!
First, let’s create a regular text field.
And now a word with a spelling error is intentionally introduced there. Let’s say the word ‘blue’. In order to highlight the error, it is enough to highlight the entered word.
As a result, our highlighted word ‘blue’ will be underlined with a red wavy line. Congratulations, you have witnessed the spell check mode in action. Note that we didn’t have to use the spellcheck attribute for this, because this mode was initially enabled by default. By correcting the spelling mistake in the word ‘blue’, the red wavy line will disappear.
Now I will show you how to disable this mode. To do this, we use the spellcheck attribute.
Specify false as the attribute value. As a result, no matter what we type in this text area, spelling errors will not be highlighted. To be honest, I don’t even know what this is for, well, unless you use your own spell checkers or you don’t need them at all. Draw your own conclusions!
My job is to show you that this possibility exists.
In order to activate the spell check mode, you need to set the spellcheck attribute to true, but again, I repeat that this mode is enabled in browsers by default.
In addition to form text fields, this attribute can be applied to elements containing the contenteditable=»true» attribute. That is, the elements of the text content of which we can edit.