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
language information and text direction
Title
Style
Events
onclick, ondblclick, onmousedown, onmouseup, onmouseover, onmousemove, onmouseout, onkeypress, onkeydown, onkeyup.
Tabbing navigation
Client side image maps
Form submission
name.
visual presentation
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
Note
Note that applet element is deprecated in favor of object element.
Previous: HTML area tag and element
Next: HTML param tag and element
Test your Programming skills with w3resource's quiz.
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://w3resource.com/html/object/HTML-object-tag-and-element.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics