HTML | DOM Textarea maxlength Property Last Updated : 12 Apr, 2019 Summarize Comments Improve Suggest changes Share Like Article Like Report The DOM Textarea maxlength Property is used to set or return the value of the maxlength attribute of a textarea field. It specifies the maximum number of characters that have been allowed in the Element. Syntax: It is used to return the maxLength property: textareaObject.maxLength It is used to set the maxLength property: textareaObject.maxLength = number Property Values number: It specifies a maximum number of characters that are allowed in the Textarea Element. Return Value: It returns a numeric value which represents the maximum number of characters that have been allowed in the Textarea field. Example-1: HTML Program to illustrate how to return the maxlength property. html <!DOCTYPE html> <html> <body> <center> <h1 style="color:green; font-style:italic;"> GeeksforGeeks </h1> <h2 style="color:green; font-style:italic;"> DOM Textarea maxlength Property </h2> <textarea rows="4" cols="50" id="GFG" maxlength="6"> write here.... </textarea> <br> <br> <button onclick="myGeeks()"> Submit </button> <p id="sudo"></p> <script> function myGeeks() { // Return max length allowed in the textarea field. var x = document.getElementById("GFG").maxLength; document.getElementById("sudo").innerHTML = "There are only " + x + " maximum characters" + "are allowed in a Textarea Field.";; } </script> </body> </html> Output: Before Clicking On Button: After Clicking On Button : Example-2 : HTML Program to illustrate how to set the maxlength property. html <!DOCTYPE html> <html> <body> <center> <h1 style="color:green; font-style:italic;"> GeeksforGeeks </h1> <h2 style="color:green; font-style:italic;"> DOM Textarea maxlength Property </h2> <textarea rows="4" cols="50" id="GFG" maxlength="6"> write here.... </textarea> <br> <br> <button onclick="myGeeks()"> Submit </button> <p id="sudo"></p> <script> function myGeeks() { // Set maxlength 4. var x = document.getElementById("GFG").maxLength = "4" document.getElementById("sudo").innerHTML = "Maximum number of characters allowed"+ "in the text area is now 4."; "4" } </script> </center> </body> </html> Output: Before Clicking On Button: After Clicking On Button: Supported Browsers: The browser supported by Textarea maxLength Property are listed below: Google Chrome Internet Explorer Firefox Opera Safari Comment More infoAdvertise with us Next Article HTML | DOM Style listStyleImage Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads HTML | DOM Style listStyleImage Property The listStyleImage property is used to set or return an image as the list-item icon. Syntax: Return the listStyleImage property:object.style.listStyleImageSet the listStyleImage property:object.style.listStyleImage = "none| url| initial| inherit" Properties: none: Using this property, no image will 2 min read HTML | DOM TableHeader Object The TableHeader object in HTML DOM is used to represent the HTML <th> element. The <th> element can be accessed by using getElementById() method. Syntax: It is used to access <th> element. document.getElementById("id"); It is used to create <th> element. document.createElemen 3 min read HTML | DOM Input Text Object The Input Text Object in HTML DOM is used to represent the HTML <input> element with type="text" attribute. The <input> element with type="text" can be accessed by using getElementById() method. Syntax: It is used to access input text object. document.getElementById("id");It is used to c 3 min read HTML DOM TransitionEvent The HTML DOM TransitionEvent represents events that occur when a CSS transition starts, ends, or is canceled. This event is fired at the end of a CSS transition (i.e., when the transition finishes) or when the transition is canceled. It provides information about the transition, such as the name of 2 min read HTML | DOM Style maxHeight Property The maxHeight property set/return the maximum height of an element. The maxHeight property affect only on block-level elements, absolute or fixed position elements. Syntax: It is used to set the maxHeight property:object.style.maxHeight = "none|length|%|initial|inherit"It is used to return the maxHe 2 min read HTML | DOM Style borderTopStyle Property The DOM Style borderTopStyle property is used to set or return the top border style of an element. Syntax: To get the borderTopStylePropertyobject.style.borderTopStyleTo set the borderTopStylePropertyobject.style.borderTopStyle = "none | hidden | dotted | dashed | solid | double | groove |ridge | in 7 min read HTML | DOM Style transitionDuration Property The Style transitionDuration property in HTML DOM is used to set or return the length of time(in seconds or milliseconds) to complete the transition effect. Syntax: Return the transitionDuration property:object.style.transitionDurationSet the transitionDuration:object.style.transitionDuration = "tim 1 min read HTML ondragstart Event Attribute HTML ondragstart Event Attribute is used when the user wants to drag the text or element. It is simply the process in which we press on the desired text to drag and drop them to a different location. Basically, it Initiates when the user starts dragging an element and is used to set data to be trans 3 min read HTML | DOM Style animationDelay Property The animationDelay Property in HTML DOM is used to set or returns the delay after which the animation should start. Syntax: It is used to set the animationDelay property:object.style.animationDelay = "time|initial|inherit"It is used to return the animationDelay property:object.style.animationDelay P 3 min read HTML | DOM Window parent Property HTML DOM Window parent Property returns the parent window of the current window. It is a read-only property. If a window does not have a parent, then it refers to itself. Syntax: window.parent Return Value: Parent Window object of current window. If there is no parent window then it refers to itself 1 min read Like