HTML | DOM Textarea required Property Last Updated : 21 Jul, 2022 Comments Improve Suggest changes Like Article Like Report The DOM Textarea required Property is used to set or return the Whether that the input element must be filled out before submitting the Form. This Property is used to reflect the HTML required attribute.Syntax: It is used to Return the required property: textareaObject.requiredIt is used to Set the required property: textareaObject.required = true|false Property Values true: It specifies that the textarea field must be filled out before submitted the form.false: It has a Default value. It specifies that the textarea field is not required part of the form. Return Value: It returns a Boolean value which represents that the textarea field must be filled out or not before submitting the form.Example-1: In HTML Program that illustrate how to return the required property. html <!DOCTYPE html> <html> <head> <title>DOM required textarea Property</title> <style> h1, h2 { color: green; font-style: italic; } body { text-align: center; } </style> </head> <body> <h1>GeeksForGeeks</h1> <h2>DOM required textarea Property</h2> <form action="/action_page.php"> <textarea id="GFG" rows="7" cols="50" name="comment" required> </textarea> <input type="submit"> </form> <br> <br> <button onclick="myGeeks()"> Try it </button> <p id="sudo"></p> <script> function myGeeks() { // Return Textarea property var x = document.getElementById("GFG").required; document.getElementById("sudo").innerHTML = x; } </script> </body> </html> Output: Before Clicking On Try it Button: After Clicking On Try it Button: Example-2: In HTML Program that illustrate how to set the required property. html <!DOCTYPE html> <html> <head> <title>DOM required textarea Property</title> <style> h1, h2 { color: green; font-style: italic; } body { text-align: center; } </style> </head> <body> <h1>GeeksForGeeks</h1> <h2>DOM required textarea Property</h2> <form action="/action_page.php"> <textarea id="GFG" rows="7" cols="50" name="comment"> </textarea> <input type="submit"> </form> <br> <br> <button onclick="myGeeks()"> Try it </button> <p id="sudo"></p> <script> function myGeeks() { // Set Textarea property. var x = document.getElementById("GFG").required = true; document.getElementById("sudo").innerHTML = "Now the value of required attribute is set to True"; } </script> </body> </html> Output :Before Clicking On Button: After Clicking On Button: Supported Browsers: The browser supported by Textarea required Property are listed below: Google Chrome 4 and aboveEdge 12 and aboveInternet Explorer 10 and aboveFirefox 4 and aboveOpera 12.1 and aboveSafari 5 and above Comment More infoAdvertise with us Next Article HTML | DOM Ol type Property M manaschhabra2 Follow Improve Article Tags : Misc Web Technologies HTML HTML-DOM Practice Tags : Misc Similar Reads HTML | DOM Ol type Property The DOM Ol type Property is used to set or return the type attribute in an ordered list. This attribute defines which type(1, A, a, I and i) of order you want in your list numeric, alphabetic or roman numbers. Syntax: It is used to return the type property. olObject.type It is used to set the type p 2 min read HTML | DOM Form enctype Property The Form enctype property in HTML DOM is used to set or return the value of the enctype attribute in a form. This attribute specifies the data that will be present in the form should be encoded when submitting to the server. This type of attribute can be used only if method = "POST". Syntax: It is u 3 min read HTML DOM Form reset() Method The reset() method in the HTML DOM is used to reset a form fields to their default values. When a form is reset, all user input is cleared, and the fields revert to their initial states.SyntaxformObject.reset()Example: In this example, clicking the reset button clears the form inputs. html<!DOCTY 1 min read HTML | DOM Form submit() Method The form submit() Method in HTML DOM is used to send the form data to the web-server. It works as same as submit button. It does not contain any parameters. Syntax: formObject.submit()Example: index.html<!DOCTYPE html> <html> <head> <title> HTML DOM Form submit() Method </ 1 min read HTML | DOM Location Search Property The Location Search property in HTML DOM is used to set or return the query part of URL including question mark. The query part is the part of URL after the question mark. Syntax: It returns the location search property.location.searchIt is used to set the location search property.location.search = 1 min read HTML DOM Form action Property The HTML DOM Form action property allows accessing and modifying the action attribute of a form element through JavaScript. It determines the URL where form data is submitted when the form is submitted. Syntax: It is used to return the action property. formObject.actionIt is used to set the action p 3 min read HTML | DOM Form autocomplete Property The Form autocomplete property in HTML DOM is used to set or return of the autocomplete attribute. The autocomplete attribute is used to specify whether the autocomplete attribute has "on" or "off" value. When the autocomplete attribute is set to on so the browser will automatically complete the val 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 HTML DOM Video Object The Video object in HTML DOM represents an <video> element. The video element can be accessed by using getElementById() method. Syntax: To access a video object: document.getElementById("videoId");where id is assigned to the <video> tag.To create a video object: document.createElement("V 4 min read HTML | DOM Input Month Object The Input Month Object in HTML DOM is used to represent an HTML input element with type= "month" attribute. The input element with type= "month" attribute can be accessed by using getElementById() method. Syntax: It is used to access <input> element with type="month" attribute.document.getElem 3 min read Like