Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Input Datetime form attribute

Input Datetime form attribute

Input Datetime Object Reference Input Datetime Object

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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 Reference Input Datetime Object