The HTML <object></object> element instructs the browser to request another file which will be embedded within the element, or to embed a suitable plugin within the element. This duplicates the functionalities of the applet, img, and iframe elements, but does not (yet) supersede them, possibly due to limited browser support. Additionally, the new video and audio elements duplicate functionality found in this element.

The example at right was originally formulated by Bruce Lawson. It is valid as HTML5 and works in all browsers. If it looks too complex to be used, see the video element.

Optional attributes

Attribute Value Description
data URL The location of a file to be embedded.
type MIME type The format of the file, or a handle for a plugin.
name browsing context name A unique, non-empty name by which scripts and target attributes may refer to the element.
usemap hash-name The hash-name of a map which defines clickable portions of the image.
form text The id of a form which resides within the same document. The element becomes a field of the specified form.
height pixels The height of the object, measured in CSS pixels.
width pixels The width of the object, measured in CSS pixels.

Global attributes

See Global HTML Attributes.

See also

External links