Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML <Textarea>maxlength attribute

Improve Article
Save Article
  • Last Updated : 09 Jan, 2020
Improve Article
Save Article


The HTML <Textarea>maxlength attribute is used to specify the maximum number of characters enters into the Textarea element.

Syntax:

<Textarea maxlength ="number">

Attribute Value:

    number: It contains single value number which allows the maximum number of character in Textarea element. Its default value is 524288.

Example:




<!DOCTYPE html> 
<html
  
<head
    <title>Textarea maxlength Attribute</title
    <style
    
    fieldset { 
        width: 50%; 
        margin-left: 22%; 
    
    h1 { 
        color: green; 
    
    </style
</head
  
<body
    <center
        <h1>GeeksforGeeks</h1
        <h2>Textarea maxlength Attribute</h2
        <textarea form="mygeeks"  maxlength="9"
        </textarea
        <br
        <form id="mygeeks"
            Name: 
            <input type="text" name="usrname"
            <input type="submit"
        </form
    </center
</body
  
</html

Output:

Supported Browsers: The browsers supported by HTML <Textarea>maxlength attribute are listed below:

  • Google Chrome
  • Internet Explorer 10.0 +
  • Firefox 4.0
  • Opera 15.0
  • Safari

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!