Object form attribute

Definition and usage

form Attribute sets or returns the form of the <object> element form attribute The value.

The form attribute specifies one or more forms that belong to the <object> element.

See also:

HTML Reference Manual:HTML <object> form Attribute

HTML Reference Manual:HTML <object> Tag

Example

Get the id of the form that belongs to the <object> element:

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

Try it yourself

Syntax

Return the form attribute:

objObject.form

Set the form attribute:

objObject.form = form_id

Attribute value

Value Description
form_id

Specifies the <form> element that belongs to the <object> element.

The value of this attribute must be the id attribute of the <form> element in the same document.

Technical Details

Return Value: A string value that represents one or more forms to which the object belongs.

Browser Support

Chrome Edge Firefox Safari Opera
Chrome Edge Firefox Safari Opera
Support Support Support Support Support

Note:All mainstream browsers support the form attribute. However, no mainstream browser supports the form attribute of the <object> element.