Computer >> Computer tutorials >  >> Programming >> HTML

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.

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>