Home > Abakada: Back to Basics > Language References > HTML Elements > OBJECT Element
Inserts an object into the HTML page. | HTML 2, 3.2, 4, 4.01, 5 |
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_style_rules
tabindex = n
title = text
type = mime-type
width = n
>
NOTE: Both start and end tags are required.
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.
The <object>
element supports the following attributes, in addition to global attributes common to all HTML elements.
data | URL | Specifies the URL of the resource to be used by the object |
form | form_id | Specifies which form the object belongs to |
height | pixels | Specifies the height of the object |
name | name | Specifies a name for the object |
type | media_type | Specifies the media type of data specified in the data attribute |
typemustmatch | true/false | Specifies whether the type attribute and the actual content of the resource must match to be displayed |
usemap | #mapname | Specifies the name of a client-side image map to be used with the object |
width | pixels | Specifies the width of the object |
The following example shows how the <object
> element may be used.
<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.
AUDIO EMBED PICTURE VIDEO