w3resource

HTML object tag and element

1. HTML object element is used to embed external resources such as image, video, audio, Java applet, Flash, PDF, ActiveX etc.

2. The element can be used to implement an included object, the data to be displayed and for additional values required by the object at run-time.

2. object element starts with <object> tag and and ends with </object> tag.

3. Since object element is not supported in by all major browsers, usage of the element is limited.

4. Object elements can be nested and taking this opportunity, you can specify several objects each for one browser.

Syntax

<object>.....</object>

Category

HTML object element is a part of HTML object, image and applet.

Whether both start and end tags are required

Both start end tags are required.

Can contain

HTML object element can contain param elements followed by Block-level elements and/or Inline elements.

Can reside within

HTML object element can reside within Inline elements, Block-level elements except pre.

Attributes

classid, codebase, codetype, data, type, archive, declare, standby.

Identifiers

id, class.

language information and text direction

lang, dir.

Title

Title.

Style

Style.

Events

onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup.

Tabbing navigation

tabindex.

Client side image maps

ismap, usemap.

Form submission

name.

visual presentation

align, width, height.

Supported doctypes

HTML 4.01 Strict, HTML 4.01 Transitional, and HTML 4.01 Frameset.

Example of using HTML object element

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>HTML object tag example</title>
</head>
<body>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave
/cabs/flash/swflash.cab#version=7,0,19,0" width="1025" height="800" title="A demo flash movie">
<param name="movie" value="/html/object/demo.swf">
<param name="quality" value="high">
<embed src="/html/object/demo.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1025" height="800"></embed>
</object>
</body>
</html>

View this example in a separate browser window

HTML object tag example.

Note

Note that applet element is deprecated in favor of object element.

Previous: HTML area tag and element
Next: HTML param tag and element