<object> element defines objects to be embedded in a page. It was intended as a replacement for the
<applet> elements as an all-purpose generic solution to placing content such as images, audio, video,
Java applets, Flash and PDF documents into a web page.
The trouble with using
<object> is that it hasn't been universally adopted by browsers and some will include objects
as intended but others ignore the object and display the content between the
<object/> tags instead
of embedding the external object.
According to the HTML specification the following code should place an image on the screen:
<object>element you will see a picture on the left of the screen but if not you will see a 'NOT SUPPORTED' message.
At the time of writing this page Firefox and Chrome and IE9 will display the image that has been included with the
element but IE8 and earlier will display the content between the
<object/> tags and not include
You can get round this by embedding objects within each other to cater for the different browser behaviour but this makes for very
complicated coding and doesn't follow the spirit of why the
<object> element was added to the specification.
- CORE AND LANGUAGE ATTRIBUTES - class, id, title, style, dir, lang
- EVENT ATTRIBUTES - onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmouseout, onmousemove, onkeydown, onkeyup, onkeypress, onblur, onfocus
- classid - gives the location(URI) of an object.
- codebase - specifies the path for resolving relative URI's given by the classid, data or archive attributes. Default is current document.
- codetype - specifies the content type to expect when downloading the object loaded through classid.
- data - a URI, the location of the object.
- type - the content type of the data expected from the data attribute.
- archive - a list of URI's separated by spaces containing information relevant to the object.
- declare - a boolean value which when set makes this purely a declaration for a subsequent object inclusion.
- standby - contains a text message for display whulst the object is loading.
- tabindex - the position of this element in the tabbing order.
- usemap - associates an image map with the
- name - identifies the object if it is used within a form.
- width - the width of the object when applicable.
- height - the height of the object when applicable.