HTML DOM textarea minlength Property Last Updated : 21 Jun, 2023 Comments Improve Suggest changes Like Article Like Report The HTML DOM textarea minlength property is used to set or return the value of the minlength attribute of a textarea field. It specifies the minimum number of characters that have been allowed in the Element. Syntax: It returns the minLength property. textareaObject.minLengthIt is used to set the minLength property. textareaObject.minLength = number Property Values: number: It specifies a minimum number of characters that are allowed in the textarea element. Return Value: It returns a numeric value that represents the minimum number of characters that have been allowed in the Textarea field. Example 1: HTML program to illustrate how to return the minlength property. HTML <!DOCTYPE html> <html> <body> <h1 style="color:green; font-style:italic;"> GeeksforGeeks </h1> <h2 style="color:green; font-style:italic;"> DOM Textarea minlength Property </h2> <textarea rows="4" cols="50" id="GFG" minlength="6"> write here.... </textarea> <br><br> <button onclick="myGeeks()"> Submit </button> <p id="sudo"></p> <script> function myGeeks() { // Return minimum number of characters //allowed in the textarea field. let x = document.getElementById("GFG").minLength; document.getElementById("sudo").innerHTML = "There are only " + x + " minimum characters" + "are allowed in a Textarea Field.";; } </script> </body> </html> Output: Examples: HTML program to illustrate how to sets the minlength property. HTML <!DOCTYPE html> <html> <body> <h1 style="color:green; font-style:italic;"> GeeksforGeeks </h1> <h2 style="color:green; font-style:italic;"> DOM Textarea minlength Property </h2> <textarea rows="4" cols="50" id="GFG" minlength="6"> write here.... </textarea> <br><br> <button onclick="myGeeks()"> Submit </button> <p id="sudo"></p> <script> function myGeeks() { // change minimum number of characters //allowed in the textarea field. let x = document.getElementById("GFG").minLength = "9"; document.getElementById("sudo").innerHTML = "There are only " + x + " minimum characters" + "are allowed in a Textarea Field."; } </script> </body> </html> Output: Comment More infoAdvertise with us Next Article HTML DOM Textarea cols Property M manaschhabra2 Follow Improve Article Tags : Web Technologies HTML Web technologies HTML-DOM Similar Reads HTML | DOM Textarea name Property The DOM Textarea name Property is used to set or return the value of the name attribute of a textarea field. Syntax: It is used to return the name property.textareaObject.nameIt is used to set the name property:textareaObject.name = text/value Property Values: text: It specifies the name of the text 2 min read HTML | DOM Input Text maxLength Property The DOM Input Text maxLength Property in HTML DOM is used to set or return the value of maxlength attribute of a Text Input Field. It specifies the maximum number of characters that have been allowed in the text field. The default value of Input Text maxLength property is 524288. Syntax: It returns 2 min read HTML DOM Input URL minLength Property The Input URL minLength Property in HTML DOM is used to set or return the value of the minlength attribute of a URL Input Field. It specifies the minimum number of characters that have been allowed in the URL field. Syntax: It returns the Input url minLength property.urlObject.minLengthIt is used to 2 min read HTML | DOM Input Search maxLength Property The DOM Input Search maxLength Property in HTML DOM is used to set or return the value of maxlength attribute of a search Input Field. It specifies the maximum number of characters that have been allowed in the search field. The default value of Input search maxLength property is 524288. Syntax: It 2 min read HTML DOM Textarea cols Property The DOM Textarea cols Property is used to set or return the value of the cols attribute of a textarea field. The cols attribute how many average-width characters should fit on a single line. Syntax: It is used to return the cols property.textareaObject.colsIt is used to Set the cols property:textare 2 min read HTML | DOM Textarea rows Property The DOM Textarea rows Property is used to set or return the value of a rows attribute of a textarea field. The rows attribute specifies the number of visible text lines for the control i.e the number of rows to display. Syntax: It is used to Return the rows property:textareaObject.rowsIt is used to 2 min read Like