Input DatetimeLocal form 属性

定义和用法

form 属性返回对包含本地日期时间字段的表单的引用。

此属性在成功时返回表单对象。

注释:此属性是只读的。

实例

返回包含 <input type="datetime-local"> 元素的表单的 id:

var x = document.getElementById("myLocalDate").form.id;

亲自试一试

语法

datetimelocalObject.form

Technical details

Return value:

Reference to the form element containing the local date-time field.

If this date control is not in the form, it returns null.

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.