Language References
HTML 2, 3.2, 4, 4.01, 5
Inserts an object into the HTML page.
HTML Syntax
<object
accesskey = key
align = absbottom | absmiddle | baseline | bottom | left | middle | right | texttop | top
class = classname
classid = id
code = filename
codebase = url[#version=a,b,c,d]
codetype = media-type
data = url
datafld = colname
datasrc = #id
height = n
id = value
name = name
style = css properties
tabindex = n
title = text
type = mime-type
width = n
event = script
>
The OBJECT element can be used to embed a variety of object types in an HTML page. Among these types are plug-ins, Java components, ActiveX controls, applets, and images.
The OBJECT element’s attributes determine the type of object to embed, including the type and location of the object’s code implementation, and the type and implementation of the object’s data.
OBJECT supports alternative representations if the browser is not capable of supporting the object. The element can contain other HTML attributes, including other OBJECT elements, nested between its opening and closing tags. If the browser supports the object, it ignores all the nested HTML except the PARAM element. If it does not support the object, it parses the nested HTML but ignores the OBJECT and PARAM elements.
OBJECT can appear in the HEAD or the BODY of a document.
OBJECT Members
The following example embeds an OBJECT in the document.
<OBJECT CODEBASE="classes" CLASSid="ticker.obj"
DATA="data" WIDTH="150" HEIGHT="250">
The properties accessible for an OBJECT element depend on the contents of the OBJECT. As such, possible values returned will depend on the implementation of the OBJECT.
For example, the readyState property will return null or an error if the OBJECT does not implement a readyState property.
Authors should refer to the documentation for the individual object for supported properties.
OBJECT event handlers may also be defined in script.
<script FOR=oObject EVENT=eEvent>
...
</script>
<OBJECT id=oObject CLASSid="xyz.abc">
</OBJECT>
Note The object property for the OBJECT element is a way of reconciling DHTML Object Model members that are duplicated by the OBJECT element’s implementation and DHTML. For instance, if the OBJECT implements an item method, and DHTML implements an item method, to access the one defined for the OBJECT, we use:
document.all.objectID.object.item ( )