HTML DOM Textarea cols Property Last Updated : 28 Jun, 2023 Summarize Comments Improve Suggest changes Share Like Article Like Report 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:textareaObject.cols = number Property Values: number: It specifies the width of the textarea fields. It has a Default value i.e 20. Return Value: It returns a numeric value that represents the width of a textarea in characters. Example 1: HTML program to illustrate setting the DOM Textarea cols Property. html <!DOCTYPE html> <html> <head> <title>DOM Textarea cols Property</title> </head> <body> <h1 style="color: green;"> GeeksforGeeks </h1> <h2> DOM Textarea cols Property </h2> <!-- Below textarea is assigned a cols value 25 That is, 25 characters will fit in a line --> <textarea id="GFG" rows="4" cols="25"> A computer science portal for geeks. </textarea> <br> <button type="button" onclick="myGeeks()"> Submit </button> <script> function myGeeks() { document.getElementById("GFG").cols = "50"; } </script> </body> </html> Output: Example 2: HTML program to illustrate the return of the DOM Textarea cols Property. html <!DOCTYPE html> <html> <head> <title>DOM Textarea cols Property</title> </head> <body> <h1 style="color: green;"> GeeksforGeeks </h1> <h2> DOM Textarea cols Property </h2> <!-- Below textarea is assigned a cols value 25 That is, 25 characters will fit in a line --> <textarea id="GFG" rows="4" cols="25"> A computer science portal for geeks. </textarea> <br> <button type="button" onclick="myGeeks()"> Submit </button> <p id="sudo"></p> <script> function myGeeks() { let g = document.getElementById("GFG").cols; document.getElementById( "sudo").innerHTML = "There are " + g + " columns in a textarea width."; } </script> </body> </html> Output: Note: Both "textareaObject.cols" and "style.width" work as same. Supported Browsers: The browser supported by Textarea cols Property are listed below: Google Chrome 1 and aboveEdge 12 and aboveInternet Explorer 6 and aboveFirefox 1 and aboveOpera 12.1 and aboveSafari 4 and above Comment More infoAdvertise with us Next Article HTML | DOM Textarea placeholder Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM HTML-Property +1 More Practice Tags : Misc Similar Reads HTML | DOM Textarea maxlength Property 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 2 min read HTML | DOM meter Object The DOM Meter Object is used to represent the HTML <meter> element. The meter element is accessed by getElementById().Properties: form: It belongs to one or more forms that it belongs too.max: It is used to specify the maximum value of a range.min: It is used to specify the minimum value of a 2 min read HTML | DOM Textarea placeholder Property The DOM Textarea placeHolder Property is used to set or return the value of the placeholder attribute of a textarea field. It specifies a short hint that describes the expected value of an input field / textarea. A short message or hint displayed before entering value in textarea. Syntax: It is used 2 min read HTML | DOM Style backfaceVisibility Property The backfaceVisibility property is the deciding factor that would make an element visible or invisible when the element is not facing the screen. This property is helpful when an element is rotated, and its backside needs to be hidden. Syntax: Return the backfaceVisibility property:object.style.back 3 min read HTML | DOM HTML Object The HTML Object property in HTML DOM is used to represent or access the HTML <html> element with in the object. The <html> element is used to return the HTML document as an Element Object. Syntax: It is used to access a <html> element.var x = document.getElementsByTagName("HTML")[0 3 min read HTML | DOM IFrame Object The IFrame Object property in HTML DOM is used to create and access the <iframe> element within the object. An inline frame is used for embedding another document within the current HTML document. Syntax:It is used to access a <iframe> element.var x = document.getElementById("myframe");I 3 min read HTML | DOM Input Color Object The Input Color Object property in HTML DOM is used to create and access the <input> element within the object. The <input> is used to enter data in the input field. Declaration of input control that allow user to input data is can be done by <input> elements are used within a < 3 min read HTML | DOM TableData Object The TableData object in HTML DOM is used to represent the HTML td element. The td element can be accessed by using getElementById() method. Syntax: To Access td Element: document.getElementById("id");To Create td Element: document.createElement("td"); TableData Object Properties: PropertyDescription 3 min read HTML | DOM Input Number Object The Input Number Object in HTML DOM is used to represent an HTML input element with type= "number". The input element with type= "number" can be accessed by using getElementById() method. Syntax: It is used to access input number object.document.getElementById("id");It is used to create input elemen 3 min read HTML | DOM Style overflowY Property The Style overflowY property in HTML DOM is used to specify the behavior of the content when it overflows an element's top and bottom edges. The content may be hidden, shown or a scrollbar according to the value. Syntax: It returns the overflowY property.object.style.overflowYIt is used to set the o 6 min read Like