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

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

 
 

Share on Google+Share on Google+

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

Ads

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

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

In this tutorial, We will introduce you about the required attribute of the <textarea> tag in html5. This attribute is used to specify that the input textarea is must be filled by user and it is mandatory.  

Declaration Syntax:  

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

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

This attribute have following possible values.

  • required="required".
  • required

Example: required_attribute.html

<!DOCTYPE html>
<html>
  <head>
      <title>Example of required attribute</title>
  </head>
   <body>The textarea here.<br><br>
   <form>
        <textarea rows="5" cols="30" required="required">
    </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