Share on Google+Share on Google+

html5 maxlength attribute, Example of maxlength attribute of <textarea> tag in html5

Advertisement
In this tutorial, We will introduce you about the maxlength attribute of the <textarea> tag in html5.

html5 maxlength attribute, Example of maxlength attribute of <textarea> tag in html5

In this tutorial, We will introduce you about the maxlength attribute of the <textarea> tag in html5. This attribute is used to specify that the maximum number of character can be entered in the input textarea. The user can not able to input more character in the textarea.  

Declaration Syntax:  

The attribute is used as in the <textarea> tag:

<textarea maxlength="value">Text Here</textarea>

This attribute have non negative integer  values.

Example: maxlength_attribute.html

<!DOCTYPE html>
<html>
  <head>
      <title>Example of maxlength attribute</title>
  </head>
   <body>You can not more than 10 characters.<br>
   <form>
        <textarea rows="5" cols="30" maxlength="10">
    </textarea>
  </form>
  </body> 
</html>

Output:

Download This Example:

Difference between html4.01 and html5

This attribute is new in the html5.

Advertisements

Posted on: September 17, 2010 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.