Sign in Registration
ruen

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 .

html-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.

Comments (0)
For commenting sign in or register.
Оставить заявку

Latest articles

Popular sections

Eqsash (Tools)

Android app - VK LAST USER ID, отучитель от зависимости и т.д.:
Available on Google Play

Amessage (Communication)

Login to the web version
Android app:
Available on Google Play

Share this

Subscribe to

YouTube

Books

IT notes - In simple language about the most necessary things (HTML, CSS, JavaScript, PHP, databases, Drupal, Bitrix, SEO, domains, security and more), PDF, 500 p.