Input Datetime type property
Example
Returns the form element type of the datetime field:
var x = document.getElementById("myDatetime").type;
xOutput value:
datetime
Try it »
Definition and Usage
The type property returns the form type of the datetime field.
Note: In the example above, Safari and Opera 12 (and earlier versions) browsers return "datetime", while Opera 15 (and later versions), Internet Explorer, Firefox and Chrome browsers return "text".
Browser support





All major browsers support the type attribute.
Note: In the example above, Internet Explorer, Firefox, Opera version 15 (and later) or Chrome browsers do not support it .
Syntax
datetimeObject
.type
Technical Details
| Return Value: | String representing the form element type of the datetime field |
|---|
Input Datetime Object