Input DatetimeLocal typeProperty

Input DatetimeLocal 对象参考手册Input DatetimeLocal Object

Examples

Return the form element type of the local datetime field:

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

xThe output result is:

datetime-local

Try it yourself »

Definition and Usage

The type property returns the form element type of the local datetime field.

Note:In the above examples, Internet Explorer and Firefox return "text" instead of "datetime-local".


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the type property.

Note:Internet Explorer or Firefox browsers do not support the <input> element.


Syntax

datetimelocalObject.type

Technical Details

Return value: A string representing the form element type of the local datetime field


Input DatetimeLocal 对象参考手册Input DatetimeLocal Object Other Extensions