` element belongs: ``` var x = document.getElementById("myDatetime").form.id; ``` ``` myForm ```"> ` element belongs: ``` var x = document.getElementById("myDatetime").form.id; ``` ``` myForm ```" />
Easy Tutorial
❮ Obj Storage Dom Obj Email ❯

Input Datetime form Attribute

Input Datetime Object

Example

Returns the form ID to which the <input type="datetime"> element belongs:

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

Definition and Usage

The form attribute returns a reference to the form that contains the datetime field.

On success, this attribute returns a form object.

Note: This attribute is read-only.


Browser Support

All major browsers support the form attribute.

Note: Internet Explorer, Firefox, Opera 15 (and later versions), or Chrome support the <input> element with type="datetime".


Syntax

Technical Details

| Return Value: | A reference to the form element that contains the datetime field. Returns null if the datetime field is not in a form. | | --- | --- |

❮ Obj Storage Dom Obj Email ❯