How to turn off spell checking for HTML form elements ? - GeeksforGeeks (2024)

Table of Contents
HTML Please Login to comment...

Improve

Improve

Like Article

Like

Save

Report

You may have noticed often that while filling a form in any website if we made any spelling or grammatical mistake it would get underlined by a red wavy line. It is sometimes annoying for the user as he/she may get distracted by it. So, many websites turn off the Spell Check Feature for their users. The Spell Check feature in HTML is used to identify grammatical or spelling mistakes made by the user while giving the input in the form. In this article, we will discuss how to turn off the spell check feature for the HTML form element

Spell Check feature can be enabled/disabled using an attribute called spellcheck which defines whether the HTML element will be checked for the errors or not. It takes two values, either true or false. When you give the value as true, it will be turned on and will check for any grammatical/ spelling errors present in the field, and when the value is given false, it will get turned off and will not check for any errors. The spellcheck attribute supports all the HTML form elements.

Syntax:

<form spellcheck="value (either true or false)"></form>

For Input Field:

<input type="text" spellcheck="value (either true or false)">

For Text Area Field:

<textarea type="text" spellcheck="value (either true or false)"></textarea>

Now let’s see an example of how to turn it off by writing an HTML code for the same.

HTML

<!DOCTYPE html>

<html>

<head>

<title>Turn off Spell Check Feature</title>

</head>

<body>

<h2>

Demonstration of how to turn off the

spell check for HTML Form Elements

</h2>

<form>

<p>Name: <input type="text" spellcheck="true"></p>

<br>

<p>

Message: <textarea type="text"

spellcheck="false"></textarea>

</p>

</form>

</body>

</html>

Output: You can notice in both the fields that there is one red wavy line under the words of the first column showing the grammatical errors because spellcheck is true in this field whereas in the text area the spell check is false that’s no red wavy line is not appear under the wrong words.

How to turn off spell checking for HTML form elements ? - GeeksforGeeks (1)



Last Updated : 04 Oct, 2021

Like Article

Save Article

Share your thoughts in the comments

Please Login to comment...

How to turn off spell checking for HTML form elements ? - GeeksforGeeks (2024)
Top Articles
Latest Posts
Article information

Author: Dong Thiel

Last Updated:

Views: 5866

Rating: 4.9 / 5 (79 voted)

Reviews: 94% of readers found this page helpful

Author information

Name: Dong Thiel

Birthday: 2001-07-14

Address: 2865 Kasha Unions, West Corrinne, AK 05708-1071

Phone: +3512198379449

Job: Design Planner

Hobby: Graffiti, Foreign language learning, Gambling, Metalworking, Rowing, Sculling, Sewing

Introduction: My name is Dong Thiel, I am a brainy, happy, tasty, lively, splendid, talented, cooperative person who loves writing and wants to share my knowledge and understanding with you.