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.
Latest articles
- 09.07.22IT / Misc Convert office files DOC, DOCX, DOCM, RTF to DOCX, DOCM, DOC, RTF, PDF, HTML, XML, TXT formats without loss and markup changes
- 07.07.22IT / Safety How to protect PHP, JS, HTML, CSS source code - obfuscation, minification, compression and encryption
- 06.07.22IT / Safety Connection not secure, problem with Lets Encrypt - how to fix expired 09/30/2021 DST Root CA X3, remove it manually and install ISRG Root X1. Example on MS Windows 7
- 08.07.21IT / Misc How to make a free translation for a website without an API, translate documents in Google Translate
- 06.07.21IT / Misc How to make a subscription button on a website, a subscriber base and automatic mailing