SpellCheck Attribute in HTML5

In this article I am going to describe about how to use spellcheck attribute in HTML5
  • 5500

 SpellCheck Attribute in HTML5

SpellCheck attribute is new in HTML5.When we use spellcheck attribute with any element then it automatically check the spelling and grammer. If the value we have inserted is wrong then the element value will be displayed with red underline.

SpellCheck attribute tells a browser whether or not to check the spelling/grammer of the text in an editable element

Following element can be spellchecked

  1. Text value in input element.
  2. Text value in editable element.
  3. Text value in text area

Syntax

<element spellcheck="True|False">

 SpellCheck Attributes

      Value                                    Description
       True   The element need to be checked for its spelling and grammer.
       False    The element does not need to be checked

Browser Support

SpellCheck attribute is currently supported in Opera, Chrome and Safari.

It is not supported in Internet Explorer and Firefox.

Example of SpellCheck Attribute in HTML5

<!DOCTYPE html>

<html lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>

    <title>Spellcheck Attribute of HTML5</title>

</head>

<body>

    <h1>Spellcheck Attribute in HTML5</h1>

    <p contenteditable="True" spellcheck="true">This is a paragraph in HTML5.</p>

    Enter UserName:<input type="Text" name="username" spellcheck="true" />

    <p><b>Note:</b>Spellcheck Attribute is new in HTML5</p>

</body>

</html>

 

Output

spellcheck.jpg

© 2019 DotNetHeaven. All rights reserved.