Summary
The HTML Embedded Object Element (<object>) represents an external resource, which can be treated as an image, a nested browsing context, or a resource to be handled by a plugin.
- Content categories Flow content; phrasing content; embedded content, palpable content; if the element has a usemap attribute, interactive content; listed, submittable form-associated element.
- Permitted content zero or more {{HTMLElement("param")}} elements, then transparent.
- Tag omission {{no_tag_omission}}
- Permitted parent elements Any element that accepts embedded content.
- DOM interface {{domxref("HTMLObjectElement")}}
Attributes
This element includes the global attributes.
- {{htmlattrdef("archive")}} {{HTMLVersionInline(4)}} only; {{obsoleteGeneric('inline','HTML5')}}
- A space-separated list of URIs for archives of resources for the object.
- {{htmlattrdef("border")}} {{deprecatedGeneric('inline','HTML4.01')}}; {{obsoleteGeneric('inline','HTML5')}}
- The width of a border around the control, in pixels.
- {{htmlattrdef("classid")}} {{HTMLVersionInline(4)}} only; {{obsoleteGeneric('inline','HTML5')}}
- The URI of the object's implementation. It can be used together with, or in place of, the data attribute.
- {{htmlattrdef("codebase")}} {{HTMLVersionInline(4)}} only; {{obsoleteGeneric('inline','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.
- {{htmlattrdef("codetype")}} {{HTMLVersionInline(4)}} only; {{obsoleteGeneric('inline','HTML5')}}
- The content type of the data specified by classid.
- {{htmlattrdef("data")}}
- The address of the resource as a valid URL. At least one of data and type must be defined.
- {{htmlattrdef("declare")}} {{HTMLVersionInline(4)}} only; {{obsoleteGeneric('inline','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. - {{htmlattrdef("form")}} {{HTMLVersionInline(5)}}
- 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 {{HTMLElement("form")}} element in the same document.
- {{htmlattrdef("height")}}
- The height of the displayed resource, in CSS pixels.
- {{htmlattrdef("name")}}
- The name of valid browsing context (HTML5), or the name of the control (HTML 4).
- {{htmlattrdef("standby")}} {{HTMLVersionInline(4)}} only; {{obsoleteGeneric('inline','HTML5')}}
- A message that the browser can show while loading the object's implementation and data.
- {{htmlattrdef("tabindex")}} {{HTMLVersionInline(4)}} only; {{obsoleteGeneric('inline','HTML5')}}
- The position of the element in the tabbing navigation order for the current document.
- {{htmlattrdef("type")}}
- The content type of the resource specified by data. At least one of data and type must be defined.
- {{htmlattrdef("typemustmatch")}} {{HTMLVersionInline(5)}}
- This Boolean attribute indicates if the type and the actual content type resource must match in order of this one to be used.
- {{htmlattrdef("usemap")}}
- A hash-name reference to a {{HTMLElement("map")}} element; that is a '#' followed by the value of a {{htmlattrxref("name", "map")}} of a map element.
- {{htmlattrdef("width")}}
- The width of the display resource, in CSS pixels.
Examples
Embed a flash movie
<!-- 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>
Specifications
Specification | Status | Comment |
---|---|---|
{{SpecName('HTML WHATWG', 'the-iframe-element.html#the-object-element', '<object>')}} | {{Spec2('HTML WHATWG')}} | |
{{SpecName('HTML5 W3C', 'embedded-content-0.html#the-object-element', '<object>')}} | {{Spec2('HTML5 W3C')}} | |
{{SpecName('HTML4.01', 'struct/objects.html#h-13.3', '<object>')}} | {{Spec2('HTML4.01')}} |
Browser compatibility
{{CompatibilityTable}}
Feature | Chrome | Firefox (Gecko) | Internet Explorer | Opera | Safari |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoDesktop("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
typemustmatch |
{{CompatUnknown}} | {{CompatGeckoDesktop("27")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
Feature | Android | Firefox Mobile (Gecko) | IE Mobile | Opera Mobile | Safari Mobile |
---|---|---|---|---|---|
Basic support | {{CompatVersionUnknown}} | {{CompatGeckoMobile("1.0")}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} | {{CompatVersionUnknown}} |
typemustmatch |
{{CompatUnknown}} | {{CompatGeckoMobile("27")}} | {{CompatUnknown}} | {{CompatUnknown}} | {{CompatUnknown}} |
See also
- {{HTMLElement("param")}}
{{HTMLRef}}