HTML 5 <object> Tag
Example
How to use the object element to display Flash:
| <object data="helloworld.swf" /> |
Try it yourself »
|
Definition and Usage
The <object> tag is used to include objects such as images, audio, videos,
Java applets, ActiveX, PDF, and Flash.
The object element allows you to specify the data and parameters for
objects inserted into HTML documents, and the code that can be used to
display/manipulate that data.
Differences Between HTML 4.01 and HTML 5
Some HTML 4.01 attributes are not supported in HTML 5.
The "form" attribute is new in HTML 5.
Objects can be used and submitted in forms.
Tips and Notes
Note: An object element can appear inside the head or the body
element. The text between the <object> and </object> is the
alternate text, for browsers that do not support this tag. The <param>
tags define run-time settings for the object.
Tip: For images use the <img> tag instead of the <object>
tag.
Tip: At least one of the "data" and "type" attributes MUST be defined.
Attributes
| Attribute |
Value |
Description |
| data |
URL |
Defines a URL that refers to the object's data |
| form |
formname |
Defines one ore more forms the object belongs to. |
| height |
pixels |
Defines the height of the object |
| name |
unique_name |
Defines a unique name for the object (to use when a form is
submitted). |
| type |
MIME_type |
Defines the MIME type of data specified in the data attribute |
| usemap |
URL |
Specifies a URL of a client-side image map to be used with the object |
| width |
pixels |
Defines the width of the object |
Standard Attributes
| class, contenteditable, contextmenu, dir, draggable, id, irrelevant, lang, ref, registrationmark, tabindex, template, title |
For a full description, go to Standard Attributes in HTML 5.
Event Attributes
| onabort, onbeforeunload, onblur, onchange, onclick,
oncontextmenu, ondblclick, ondrag, ondragend, ondragenter, ondragleave,
ondragover, ondragstart, ondrop, onerror, onfocus, onkeydown, onkeypress,
onkeyup, onload, onmessage, onmousedown, onmousemove,
onmouseover, onmouseout, onmouseup, onmousewheel, onresize, onscroll, onselect,
onsubmit, onunload |
For a full description, go to Event Attributes in HTML 5.
 |
W3Schools' Online Certification Program
The perfect solution for professionals who need to balance work, family, and career building.
More than 4000 certificates already issued!
|
The HTML Certificate documents your knowledge of HTML, XHTML, and CSS.
The JavaScript Certificate documents your knowledge of JavaScript and HTML DOM.
The XML Certificate documents your knowledge of XML, XML DOM and XSLT.
The ASP Certificate documents your knowledge of ASP, SQL, and ADO.
The PHP Certificate documents your knowledge of PHP and SQL (MySQL).
|