Input Datetime form attribute
Example
Return The form id to which the element belongs:
var x = document.getElementById("myDatetime").form.id;
x
The output is:
myForm
Try it »
Definition and Usage
The form attribute returns a reference to the form that contains the datetime field.
On success, this attribute returns the form object.
Note: This attribute is read-only.
Browser support





All major browsers support the form attribute.
Note: Supported by Internet Explorer, Firefox, Opera 15 (and later), or Chrome. element using type="datetime".
Syntax
datetimeObject
.form
Technical Details
| Return Value: | A reference to the form element containing the datetime field. If the time control is not in a form, returns null. |
|---|
Input Datetime Object