HTML Spellcheck
In this tutorial, we will learn about spellcheck attribute in HTML with the help of examples.
Spellcheck Attribute
Spellcheck attribute is used to detect grammatical mistakes in the text fields. It can be applied to HTML forms inside the <input> element.
The Spellcheck attribute is an enumerated attribute that is used to define whether the HTML element will be checked for errors or not.
- The spellcheck attribute can be used with "input" and "textarea" Elements.
- The spell check attribute has two values:
- True: The true value defines that the HTML element should be checked for errors.
- False: the false value defines that the HTML elements should not be checked for errors.
- If the attribute is not set, it will take the default value which is element type or browser defined.
Enable Spellcheck Attribute
To enable spellcheck attribute in an HTML form the value is set to true .
Example :
<!DOCTYPE html>
<html>
<head>
<title>Enable Spellcheck</title>
</head>
<body>
<h3>Enable Spellcheck</h3>
<p>
<input type = "text" spellcheck = "true"/>
</p>
<p>
<textarea spellcheck = "true"></textarea>
</p>
</body>
</html>
Output
Enable Spellcheck
Disable Spellcheck Attribute
To disable spellcheck attribute in an HTML form the value is set to false .
Example :
<!DOCTYPE html>
<html>
<head>
<title>Disable Spellcheck</title>
</head>
<body>
<h3>Enable Spellcheck</h3>
<p>
<input type = "text" spellcheck = "false"/>
</p>
<p>
<textarea spellcheck = "false"></textarea>
</p>
</body>
</html>
Output
Disable Spellcheck
Next Tutorial
We hope that this tutorial helped you develop better understanding of the concept of Spellcheck in HTML.
Keep Learning : )
In the next tutorial, you'll learn about HTML Media
Tag.