object element | object object
[This documentation is preliminary and is subject to change.]
Inserts an object into the HTML page.
![]() ![]() |
Standards information
- Document Object Model (DOM) Level 2 HTML Specification, Section 1.6.5
- HTML 4.01 Specification, Section 13.3
HTML information
| Closing Tag | required |
|---|---|
| CSS Display | inline |
DOM Information
Inheritance Hierarchy
Remarks
An object element can be a child of the head or the body element of a document.
Possible return values (those generated by Dynamic HTML (DHTML) Object Model properties) on the object element depend on the implementation of the object. For example, the readyState property returns null or error if the object does not implement a readyState property. DHTML Object Model properties available for an object depend on the content of the object. For information about supported properties, see the documentation for the individual object.
Events are sent directly to the object element. If the event is returned by the embedded object, it bubbles accordingly. If the event is not returned, it does not bubble.
Note You can use the object property for the object element to reconcile DHTML Object Model members that are duplicated by the object element's implementation and by DHTML. For instance, if the object implements an item method and DHTML implements an item method, use document.all.objectID.object.item() to access the one defined for the object.
Windows Internet Explorer 9. In IE9 Standards mode, the object element is allowed to load content from other domains. In IE8 Standards mode, however, this is not allowed.
Windows Internet Explorer 8 and later. IE8 mode enables several enhancements to the object element that are not available when pages are displayed in earlier document modes.
-
Images are supported as native object types.
-
The values of the codeBase and data attributes depend on the current document compatibility mode.
-
Object fallback is supported when an object fails to load for communication or cross-domain security failures.
Note Object fallback does not occur when the contentEditable property of the document object is set to
true. -
The title attribute is preferred over the alt attribute when specified as a pop-up tooltip.
-
When the value of the data attribute specifies the data URI protocol, the value is not passed to Microsoft ActiveX controls upon instantiation. This preserves compatibility with older ActiveX controls that do not support the data URI protocol.
Examples
The following example uses the script element to define event handlers on the object element.
<SCRIPT FOR=oObject EVENT=eEvent> : </SCRIPT> <OBJECT ID=oObject CLASSID="xyz.abc"> </OBJECT>
The following example illustrates that when an object fails to instantiate for any reason, the HTML inside the object element is rendered. This provides a convenient way to inform the user that the object failed to load.
<OBJECT CLASSID="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95"> <SPAN STYLE="color:red">ActiveX control failed to load! -- Please check browser security settings.</SPAN> </OBJECT>
Build date: 3/8/2012
(Except the sliders are cursor:hand.)
- 4/22/2011
- Mr. Raymond Kenneth Petry
- White space following an OBJECT is ignored so you have to set the right margin to get an acceptable display.
- An OBJECT element within an A hyperlink is not visibly marked as a hyperlink.
- 10/7/2009
- yecril
(N.B. RELATED: Use of onmouseup popup, can cause contenteditable to belay action on its currently-selected element... REMEDY: Click on another element in the contenteditable.)
- 6/4/2009
- Mr. Raymond Kenneth Petry
- 6/9/2009
- Mr. Raymond Kenneth Petry
REMEDY: onmouseup fires,...
Note also that its Play/Pause button activates on-or-after onmouseup.
- 6/2/2009
- Mr. Raymond Kenneth Petry
- 6/9/2009
- Mr. Raymond Kenneth Petry
- 2/7/2009
- yecril
- 2/7/2009
- Thomas Lee

