Categories
HTML Web development

HTML spellcheck Attribute



HTML spellcheck Attribute

The HTML spellcheck attribute defines whether the element is to have its spelling and grammar checked or not.

The spellcheck attribute can be used with input and teaxtarea HTML elements, and the user input value can be checked for grammatical and spelling mistakes.

Syntax:

<element spellcheck="true|false"> 

true – the element is to have its spelling and grammar checked.

false – the element is not to be checked.

Example:

<!DOCTYPE html>
<html>
<body>

<p contenteditable="true" spellcheck="true">This text is editable and has some mistakkees. Try to change the text.</p>

First name: <input type="text" name="first-name" spellcheck="true">

</body>
</html>

Output:

This text is editable and has some mistakkees. Try to change the text.

First name:

Enjoy coding!

Read also:

HTML contenteditable Attribute

HTML src Attribute

HTML target Attribute