You are here: Reference > HTML > tags > object

object element

Browser support:
Specifies an object to be included in an HTML document.
The object element allows authors to embed external applications. Use the param element to specify additional object properties. The properties depend on the embedded application.
If you want to see the HTML tags by categories, please visit this page.
This element requires a closing tag.
JavaScript page for this element: object.

Possible members:

Attributes
Events
Styles
Pseudos
accessKey
Sets an access key to an element.
align
Sets the object's position with respect to the surrounding text.
alt
Sets an alternate text that is displayed when the file associated with the element cannot be displayed.
archive
Sets a space-separated list of URLs for archive files.
border
Sets the thickness of the border.
class
Sets the style class or classes that belong to the element.
classid
Sets the class identifier of the embedded application.
code
Sets the name of the Java class file that contains the Java applet.
codeBase
Sets the base location that relative URLs specified in the classid, data and archive attributes are relative to.
codeType
Sets the MIME type (media type) of the application that should be used by the object element.
contentEditable
3
Sets whether the contents of the object are editable.
data
Sets the location of the data for an object.
DECLARE
Sets whether an object is only a declaration (it isn't downloaded until it's needed).
dir
Sets the text direction as related to the lang attribute.
DISABLED
Sets the state of an object for user interaction.
draggable
3.55
Sets whether an element is draggable.
height
Specifies the height of an element.
HIDEFOCUS
Specifies whether a dotted rectangle (focus rectangle) is drawn around an object while it has focus.
hSpace
Specifies the number of pixels to use as a margin at the left and right sides of the object.
id
Sets a unique identifier for the object.
lang
Specifies the language of the element.
language
Sets the scripting language for the current element. Use it only for the script element.
name
Sets the name of an element.
standby
Specifies a text message that will be displayed while the object is loading.
style
Sets an inline style associated with an element.
tabIndex
Specifies the tabbing order for keyboard navigation using the TAB key.
title
Specifies a tooltip for an element.
type
Specifies the content type (MIME type) of the object or the linked object.
unSelectable
Sets whether the selection process can start in an element's content.
useMap
Sets the URL to use as an image map.
vSpace
Specifies the number of pixels to use as a margin at the top and bottom sides of an object.
width
Specifies the default width of the element.
xml:lang
Sets the language code of the XML document.

Example HTML code 1:

This example illustrates the use of the object element to embed a Macromedia Flash Movie.
The codeBase attribute of the object tag is missing from this example. You can check the version of the user's Flash player with this attribute in Internet Explorer, and if it does not exist or its version is lower than required, the browser pops up an installation dialog. Unfortunately, the use of the codeBase attribute causes problems in Firefox. See Example 2 for a cross-browser solution or the codeBase attribute for further details.
<object data="flash.swf" type="application/x-shockwave-flash" width="300px" height="200px">
        <!-- If flash player is not installed, pluginurl helps the user to download it in Firefox -->
    <param name="pluginurl" value="http://www.macromedia.com/go/getflashplayer" />
    
    <param name="movie" value="flash.swf" />  
    <param name="bgcolor" value="#FFFFE0" />  
    <param name="quality" value="high" />
</object>
Did you find this example helpful? yes no

Example HTML code 2:

This example illustrates the use of the object attribute with Macromedia Flash Player.
It clearly focuses on cross-browser support only, and it isn’t standards-compliant, but there isn't any standards-compliant cross-browser way to embed a Flash application into a document with Flash Player detection.
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="300" height="120" 
        codebase="http://fpdownload.adobe.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0">
    <param name="movie" value="flash.swf" />
    <!-- Optional params -->
    <param name="play" value="true" />
    <param name="loop" value="true" />
    <param name="quality" value="high" />
    <!-- END Optional -->
    <embed src="flash.swf" width="300" height="120" play="true" 
        loop="true" quality="high" 
        pluginspage="http://www.adobe.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" /> 
</object>
Did you find this example helpful? yes no

Related pages:

External links:

User Contributed Comments

Post Content

Post Content