< html‎ | elements
Jump to: navigation, search


This article is In Progress.


Inserts an object into the HTML page.

Overview Table

DOM Interface HTMLObjectElement


The following example uses the script element to define event handlers on the object element.

<SCRIPT FOR=oObject EVENT=eEvent>
<OBJECT ID=oObject CLASSID="xyz.abc">

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>



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.

Standards information

HTML information




Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari
Basic support ? ? ? ? ?


Feature Android BlackBerry Chrome for mobile Firefox Mobile (Gecko) IE Mobile Opera Mobile Opera Mini Safari Mobile
Basic support ? ? ? ? ? ? ? ?


This article contains content originally from external sources.

Portions of this content come from the Microsoft Developer Network: [Windows Internet Explorer API reference Article]