Input Datetime typeProperty
Examples
Return the form element type of the datetime field:
var x = document.getElementById("myDatetime").type;
xThe output value is:
datetime
Try it Yourself »
Definition and Usage
The type property returns the form element type of the datetime field.
Note:In the above examples, Safari and Opera 12 (and earlier versions) return "datetime", while Opera 15 (and later versions), Internet Explorer, Firefox and Chrome return "text".
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the type property.
Note:In the above examples, Internet Explorer, Firefox, Opera version 15 (and later) or Chrome browsers do not support the <input type="datetime"> element.
Syntax
datetimeObject.type
Technical Details
| Return value: | A string representing the form element type of the datetime field. |
|---|
Input Datetime Object Other Extensions