Input DatetimeLocal type Attribute

Definition and Usage

type The attribute returns what type of form element the local date-time field is.

Note:In the above example, Internet Explorer and Firefox return "textinstead of "datetime-local".

Example

What type of form element is the local date-time field returning:

var x = document.getElementById("myLocalDate").type;

Try it yourself

Grammar

datetimelocalObject.type

Technical Details

Return Value: A string value that indicates the type of form element to which the local date-time field belongs.

Browser Support

The numbers in the table indicate the first browser version that fully supports this property.

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support 10.0 Support Support Support

Note:The <input type="datetime-local"> element does not display any date-time field/calendar in Firefox.