- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to add a spellchecker for text in HTML?
To add a spellchecker, use the spellcheck attribute in HTML. The attribute checks spelling and grammer for text in input elements, <textarea> elements and editable elements.
Adding spellcheck
Write spellcheck="true" inside the text type tag.
<input type="text" name="sub" spellcheck="true">
Note − It works for input elements, but not password.
Example
You can try to run the following code to add spell checker in HTML −
<!DOCTYPE html> <html> <body> Subject: <input type="text" name="sub" spellcheck="true"> <p>Add an incorrect spelling for a word above and see what happens.</p> <p contenteditable="true" spellcheck="true">This is an editable conttent, with a spelling mistake. Click to edit.</p> </body> </html>
Advertisements