HTML tutorial
CSS3 tutorial
Bootstrap tutorial
JavaScript tutorial
JQuery tutorial
AngularJS tutorial
React tutorial
NodeJS tutorial
PHP tutorial
Python tutorial
Python3 tutorial
Django tutorial
Linux tutorial
Docker tutorial
Ruby tutorial
Java tutorial
C tutorial
C ++ tutorial
Perl tutorial
JSP tutorial
Lua tutorial
Scala tutorial
Go tutorial
ASP.NET tutorial
C # tutorial
Input Text Object : Find out if a text field must be filled out before submitting a form
The required property sets or returns whether a text field must be filled out before submitting a form.
This property reflects the HTML required attribute.
Property | |||||
---|---|---|---|---|---|
required | Yes | 10.0 | Yes | Not supported | Yes |
Return the required property:
Set the required property:
Value | Description |
---|---|
true|false |
Specifies whether a text field should be a required part of form submission.
|
Return Value: | A Boolean, returns true if the text field is a required part of form submission, otherwise it returns false |
---|
Set a text field to be a required part of form submission:
document.getElementById("myText").required = true;
HTML reference: HTML <input> required attribute
❮ Input Text Object