<object>: The External Object element
The <object>
HTML 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.
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 <param> elements, then
transparent.
|
Tag omission | None, both the starting and ending tag are mandatory. |
Permitted parents | Any element that accepts embedded content. |
Implicit ARIA role | No corresponding role |
Permitted ARIA roles | application , document , image |
DOM interface | HTMLObjectElement |
Attributes
This element includes the global attributes.
archive
-
A space-separated list of URIs for archives of resources for the object.
border
-
The width of a border around the control, in pixels.
classid
-
The URI of the object's implementation. It can be used together with, or in place of, the data attribute.
codebase
-
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.
codetype
-
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.
declare
-
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 time that the resource is reused. form
-
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. -- (Absolute values only. NO percentages)
name
-
The name of valid browsing context (HTML5), or the name of the control (HTML 4).
standby
-
A message that the browser can show while loading the object's implementation and data.
type
-
The content 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 aname
of a map element. width
-
The width of the display resource, in CSS pixels. -- (Absolute values only. NO percentages)
Examples
Embed a YouTube Video
<object type="video/mp4"
data="https://www.youtube.com/watch?v=Sp9ZfSvpf7A"
width="1280"
height="720">
</object>
Note that a type
field is normally specified, but is not needed for youtube videos.
Specifications
Specification |
---|
HTML Standard # the-object-element |
Browser compatibility
Report problems with this compatibility data on GitHubdesktop | mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
object | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
archive | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
Aspect ratio computed from width and height attributes | ChromeFull support79 | EdgeFull support79 | FirefoxFull support71 | Internet ExplorerNo supportNo | OperaFull support66 | SafariFull support14 | WebView AndroidFull support79 | Chrome AndroidFull support79 | Firefox for AndroidFull support79 | Opera AndroidFull support57 | Safari on iOSFull support14 | Samsung InternetFull support12.0 |
border | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
classid | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
codebase | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
codetype | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
data | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
declare | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
form | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
height | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
name | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
standby | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
tabindex | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
type | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
usemap | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
width | ChromeFull supportYes | EdgeFull support12 | FirefoxFull support1 | Internet ExplorerFull supportYes | OperaFull supportYes | SafariFull supportYes | WebView AndroidFull supportYes | Chrome AndroidFull supportYes | Firefox for AndroidFull support4 | Opera AndroidFull supportYes | Safari on iOSFull supportYes | Samsung InternetFull supportYes |
Legend
- Full support
- Full support
- No support
- No support
- Deprecated. Not for use in new websites.
- User must explicitly enable this feature.