HTML DOM Input DatetimeLocal required properties
Examples
Check local time field before submitting the form if required fields:
var x = document.getElementById ( "myLocalDate") required.;
x The output is: true
try it"
Definition and Usage
required property sets or returns the local time field in the form if a required field.
This property reflects the HTML required attributes.
Browser Support
All major browsers support the required properties, in addition to Internet Explorer 9 and earlier versions of IE, Safari browser.
Note: Internet Explorer or Firefox browser does not support <input type = "datetime-local "> element.
grammar
Returns required attributes:
datetimelocalObject .required
Set the required properties:
datetimelocalObject .required = true | false
Property Value
value | description |
---|---|
true | false | It describes the local time field before the form is submitted if a required part.
|
technical details
return value: | Boolean field is required if the local time of the form back to true, otherwise false. |
---|
More examples
Examples
Set the local time field to the form required parts:
. Document.getElementById ( "myLocalDate") required = true;
try it"
Related Pages
HTML Reference Manual: HTML <the INPUT> required Attribute
Input DatetimeLocal objects