How to enable or disable spell check using the spellcheck attribute
Currently modern browsers try to do spell check attribute when entering text in any fields . This is usually the default setting. But sometimes it is necessary to independently determine in which fields the text will be checked and in which not. There is a special HTML attribute for this - spellcheck .
This attribute is just a hint for browsers, it must be used correctly, it must have a value - true or false . It can usually be applied to any place where you can enter text. Most often it is:
- input ;
- textarea ;
- miscellaneous elements with the contenteditable attribute, such as the p tag.
It is important to understand that the browser may not support spell checking or it may be disabled. Therefore, you must first enable this functionality in the settings.
Browser compatibility is nearly complete, so there is no need to worry about the spellcheck attribute. This attribute is inherited, so if the parent element has such an attribute with the value true , then all nested elements will be checked for errors until the value is explicitly overridden.
Usage example below:
& lt; input type = "text" spellcheck = "false" value = "This text will not be checked for errors"> & lt; textarea spellcheck = "false"> This text will not be checked for errors & lt; / textarea> & lt; p contenteditable spellcheck = "false"> This text will not be checked for errors & lt; / p>
Thus, using the spellcheck attribute , you can easily control the spell check on any page on the site and in any field.
- IT / Misc 08.07.21 How to make a free translation for a website without an API, translate documents in Google Translate
- IT / Misc 06.07.21 How to make a subscription button on a website, a subscriber base and automatic mailing
- Food / Misc 06.07.21 How to quickly cook delicious fried pies with potatoes and onions
- IT / Misc 04.07.21 Caching - create, load and reset. Where to store the cache, methods and types of caching
- IT / Database 03.07.21 Custom NoSQL - storing data in files and not only in a database. Storing settings, small data and caching files