Latest web development tutorials

HTML DOM Input Time required properties

Input Time Object Reference Input Time Object

Examples

Check time field before submitting the form if required fields:

var x = document.getElementById ( "myTime") required.;
x The output is:
true

try it"

Definition and Usage

required property sets or returns whether the time field in the form is a required field.

This property reflects the HTML required attributes.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 type = "time" attribute of the HTML <input> elements.


grammar

Returns required attributes:

timeObject .required

Set the required properties:

timeObject .required = true | false

Property Value

value description
true | false It describes the time in the field before the form is submitted if a required part.
  • true - time fields are required parts of the form
  • false - default. time field is optional part of the form.

technical details

return value: Boolean value that, if the time fields are required parts of the form back to true, otherwise false.


More examples

Examples

Set the time for the form fields Required parts:

. Document.getElementById ( "myTime") required = true;

try it"


Related Pages

HTML <input> required Attribute
Input Time Object Reference Input Time Object