HTML | DOM Textarea required Property
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.
- It is used to Return the required property:
- It is used to Set the required property:
textareaObject.required = true|false
- true: It specifies that the the textarea field must be filled out before submittted 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.
Before Clicking On Tryit Button:
After Clicking On Tryit Button:
Example-2: In HTML Program that illustrate how to set the required property.
Before Clicking On Button:
After Clicking On Button:
Supported Browsers: The browser supported by Textarea required Property are listed below:
- Google Chrome
- Internet Explorer
Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML course.