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
- 03.04.24IT / Уроки PHP Уроки простыми словами. Урок 3. Все операторы PHP с примерами, с выводом работы кода на экран.
- 02.04.24IT / Уроки PHP Уроки простыми словами. Урок 2. Типы данных в PHP с примерами.
- 02.04.24IT / Уроки PHP Уроки простыми словами. Урок 1. Коротко о языке веб-программирования PHP. Основы синтаксиса.
- 09.11.23IT / Database Errors when migrating from MySQL 5.6 to 5.7 and how to fix them - database dump import failed with an error or INSERT does not work. Disabling STRICT_TRANS_TABLES strict mode or using IGNORE
- 08.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