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

Ads
 

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

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

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

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

In this tutorial, We will introduce you about the readonly attribute of the <textarea> tag in html5. This attribute is used to specify that the input textarea is used only for reading. The user is not able to input any character or editing in the textarea.  

Declaration Syntax:  

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

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

This attribute have following possible values.

  • readonly="readonly".
  • readonly=" ".
  • readonly

Example: readonly_attribute.html

<!DOCTYPE html>
<html>
  <head>
      <title>Example of readonly attribute</title>
  </head>
   <body>The textarea here.<br>
   <form>
         <textarea rows="5" cols="30" readonly="readonly">
    This is the sample textarea with readonly. you can not edit this area
    </textarea><br>
   </form>
  </body> 
</html>

Output:

Download This Example:

Difference between html4.01 and html5

This attribute is new in the html5.

Ads

Ads