Description

The <object> tag defines an embedded object within an HTML document. It is used to include a variety of different kinds of media files into a document such as videos, audio, Java applets, ActiveX, PDF document, Flash animations or even images. You can also use the <object> element to embed another webpage into your HTML document.

Note: The <param> element is used to pass parameters to the plugins that have been embedded with the <object> element.

The following table summarizes the usages context and the version history of this tag.

Placement:Block
Content:Block, inline, and text; any <param> elements must come first
Start/ End Tag:Start tag: required, End tag: required
Version:HTML 4, 4.01, 5

Syntax

The basic syntax of the <object> tag is given with:

HTML/XHTML: <object data="URL" type="content-type"> ... </object>

The example below shows the <object> tag in action.

<object type="application/x-shockwave-flash">
    <param name="movie" value="video/blur.swf">
</object>

Tip: It is recommended to use the type when data is specified since it allows the browser to avoid loading information for unsupported content types.

Tag-Specific Attributes

The following table shows the attributes that are specific to the <object> tag.

Global Attributes

Like all other HTML tags, the <object> tag supports the global attributes in HTML5.

Event Attributes

The <object> tag also supports the event attributes in HTML5.

Browser Compatibility

Element
<object>YesYesYesYesYes