Input URL form attribute

Definition and Usage

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

This property returns the form object upon success.

Note:This property is read-only.

Example

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

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

Try It Yourself

Syntax

urlObject.form

Technical Details

Return Value:

Reference to the form element that contains the URL field.

If the URL field is not in the form, then return null.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Supported 10.0 Supported Not Supported Supported