English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية

HTML Reference Manual

HTML Tag大全

HTML object form attribute

The form attribute specifies one or more forms to which the <object> element belongs.

 HTML <object> tag

Online Example

An <object> element located outside the form (but still part of the form):

<!DOCTYPE html>
<html>
<head>
<title>HTML: <object> form attribute - 基础教程网(oldtoolbag.com)</title>
</head>
<body>
<form action="action_page.php" id="form1">
First name: <input type="text" name="fname"><br>
<input type="submit" value="Submit">
</form>
<object data="bookmark.swf" width="400" height="400" name="obj1" form="form1></object>
</body>
</html>
Test it out ‹/›

Browser Compatibility

IEFirefoxOperaChromeSafari

Almost all mainstream browsers do not support the form attribute.

Definition and Usage

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

HTML 4.01 and HTML5differences between

The form attribute in HTML5 new attribute added in.

Syntax

<object form="form_id">

Attribute Value

ValueDescription
form_idSpecifies the <object> element's <form> element. The value of this attribute must be the id attribute of a <form> element in the same document.
 HTML <object> tag