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 Password Object : Find out if a password field must be filled out before submitting a form
The required property sets or returns whether a password field must be filled out before submitting a form.
This property reflects the HTML required attribute.
Property | |||||
---|---|---|---|---|---|
required | Yes | 10.0 | Yes | Yes | Yes |
Return the required property:
Set the required property:
Value | Description |
---|---|
true|false |
Specifies whether a password field should be a required part of form submission.
|
Return Value: | A Boolean, returns true if the password field is a required part of form submission, otherwise it returns false |
---|
Set a password field to be a required part of form submission:
document.getElementById("myPassword").required = true;
HTML reference: HTML <input> required attribute
❮ Input Password Object