element:..."> element:...">

YouTip LogoYouTip

Prop Datetime Form

HTML DOM Input Datetime form Property

HTML DOM Input Datetime form Property

Example

Return the id of the form that contains the <input type="datetime"> element:

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

The output of x will be:

myForm

Try it yourself Β»


Definition and Usage

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

On success, this property returns a form object.

Note: This property is read-only.


Browser Support

The form property is supported in all major browsers.

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


Syntax

datetimeObject.form

Technical Details

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

Input Datetime Object Reference

← Prop Datetime NameProp Datetime Disabled β†’