Input DatetimeLocal formProperty

Input DatetimeLocal 对象参考手册Input DatetimeLocal Local Object

Examples

Return the form id that the <input type="datetime-local"> element belongs to:

var x = document.getElementById("myLocalDate").form.id;
xThe output result is:
myForm

Try it Yourself »

Definition and Usage

The form property returns a reference to the form that contains the local time field.

On success, this property returns a form object.

Note:This property is read-only.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

All major browsers support the form property.

Note:Internet Explorer and Firefox do not support the <input type="datetime-local"> element.


Syntax

datetimelocalObject.form

Technical Details

Return Value: A reference to the form element containing the local time field. Returns null if the time control is not in a form.


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