Click to return to the DHTML, HTML     
NOSCRIPT Element | NOSCRI...     OL Element | OL Object     DHTML Objects    
Web Workshop  |  DHTML, HTML & CSS

OBJECT Element | OBJECT Object


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
    LANG=language
    LANGUAGE=JAVASCRIPT | JSCRIPT | VBSCRIPT  | VBS 
    NAME=name
    STYLE=css1-properties
    TABINDEX=n
    TITLE=text
    TYPE=MIME-type
    WIDTH=n
    event = script
>

Remarks

An object can appear in the HEAD or the BODY of a document.

Possible return values (those generated by 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.

OBJECT event handlers also can be defined in script (see Example).

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.

The OBJECT element is a block element and requires a closing tag.

This element is available in HTML as of Microsoft® Internet Explorer 3.0, and in script as of Internet Explorer 4.0.

Members

Styles

Example

This example uses script to define event handlers on the OBJECT element.

<SCRIPT FOR=oObject EVENT=eEvent>
:
</SCRIPT>

<OBJECT ID=oObject CLASSID="xyz.abc">
</OBJECT>


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.