Input URL formProperty

Input URL 对象参考手册Input URL Object

Example

Returns the id of the form containing the <input type="url"> element:

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

Try it yourself »

Definition and Usage

The form property returns a reference to the form containing the URL field.

If successful, this property returns a form object.

Note:This property is read-only.


Browser Support

Internet ExplorerFirefoxOperaGoogle ChromeSafari

The form property is supported by all major browsers.

Note:Internet Explorer or Safari browsers do not support HTML <input> elements with the type="url" attribute.


Syntax

urlObject.form

Technical Details

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


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