HTML » Tags » object

Version: 4.0

Compability: Explorer 4, 5  

Syntax:
<object> ... </object>

The <object> tag is used to insert an object (such as ActiveX components, applets, image maps, media players, and plug-ins) into an HTML document and to provide all of the neccessary information to implement and run the object.

For example, you can give the location and type of the executable code of the object, and the location and type of any associated data files. You have the option to declare and instantiate the object at the same time, or declare the object and instantiate it, one or more times, elsewhere in the program.

This tag can be placed in the head and the body element. If it is placed in the head, the object cannot be used to render (display) content onto the page. (No tag in the head is permitted to render content.)
 
You can insert text between the opening and closing tags that will be displayed as the default message if the object cannot be displayed by the browser.
 
The param tag is used to pass any parameters (run-time values) required to implement the object. This tag must appear immediately after the opening object tag, but before any other content.
 
Note that the applet tag was deprecated effective with version 4.0. The idea was that you were to use the object tag (and the classid attribute) to insert a Java applet into a web page. However, the applet is used extensively by large numbers of users throughout the Internet. The howls of protest guarenteed that the applet will be with us for a long time.
 
The closing tag is mandatory.
 

Examples

Code:
<object classid="clsid:8E27C92B-1264-101C-8A2F-040224009C02" ID="calFormDate" width="372" height="200">
Sorry, your browser does not display the Microsoft MSCAL Calendar
</object>
Output:
Sorry, your browser does not display the Microsoft MSCAL Calendar
Explanation:

This example displays the Microsoft MSCAL calendar.

Language(s): HTML

See Also: