Table of contents
- 1. Summary
- 2. Usage context
- 3. Attributes
- 4. DOM interface
- 5. Examples
Summary
The Embedded Object (<object>) element represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin.
Usage context
| Content categories | Flow content; phrasing content; embedded content; if the element has a usemap attribute, interactive content; listed, submittable form-associated element. |
| Permitted content | Transparent content, with the following structure:
|
| Tag omission | None, both the start tag and the end tag are mandatory. |
| Permitted parent elements | In HTML5, any element that accepts phrasing content or any element that accepts flow content. In HTML 4, an <object> element can be a child of a
<head> element, but in that case should not include any content. |
| Normative document | HTML 5, Section 4.8.4 HTML 4, Section 13.3 |
Attributes
In addition to the global attributes, this element supports the following attributes:
-
archiveHTML 4 only; Obsolete in HTML5 - A space-separated list of URIs for archives of resources for the object.
-
borderDeprecated in HTML 4.01; Obsolete in HTML5 - The width of a border around the control, in pixels.
-
classidHTML 4 only; Obsolete in HTML5 - The URI of the object's implementation. It can be used together with, or in place of, the data attribute.
-
codebaseHTML 4 only; Obsolete in HTML5 - The base path used to resolve relative URIs specified by classid, data, or archive. If not specified, the default is the base URI of the current document.
-
codetypeHTML 4 only; Obsolete in HTML5 - The content type of the data specified by classid.
-
data - The address of the resource as a valid URL. At least one of data and type must be defined.
-
declareHTML 4 only; Obsolete in HTML5 - The presence of this Boolean attribute makes this element a declaration only. The object must be instantiated by a subsequent
<object>element. In HTML5, repeat the <object> element completely each that that the resource is reused. -
formHTML5 - The form element, if any, that the object element is associated with (its form owner). The value of the attribute must be an ID of a
<form>element in the same document. -
height - The height of the displayed resource, in CSS pixels.
-
name - The name of valid browsing context (HTML5), or the name of the control (HTML 4).
-
standbyHTML 4 only; Obsolete in HTML5 - A message that the browser can show while loading the object's implementation and data.
-
tabindexHTML 4 only; Obsolete in HTML5 - The position of the element in the tabbing navigation order for the current document.
-
type - The MIME type of the resource specified by data. At least one of data and type must be defined.
-
usemap - A hash-name reference to a
<map>element; that is a '#' followed by the value of anameof a map element. -
width - The width of the display resource, in CSS pixels.
DOM interface
This element implements the HTMLObjectElement interface.
Examples
<!-- Embed a flash movie --> <object data="move.swf" type="application/x-shockwave-flash"></object> <!-- Embed a flash movie with parameters --> <object data="move.swf" type="application/x-shockwave-flash"> <param name="foo" value="bar"> </object>

