View video tutorial

HTML <object> Tag

HTML

The <object> tag represents the external resources used on the page.

HTML <object> Tag


The <object> tag defines a section for an external resource.

External resources can be audio, video, image, PDF or plugin.

Element Attributes

Attribute Value Description
data url This specifies the URL of the resource.
form form_id This specifies which form the object belongs to.
height pixels This specifies the height of the object.
name name This specifies a name for the object.
type media_type The type of resource content specified by the data.
typemustmatch true
false
This specifies that the resource should be embedded only if the value of the type attribute matches the type of resource provided in the data attribute
usemap #mapname This specifies the name of an image map to use with objects.
width pixels It specifies the width of the object.

Global attributes

Global attributes may be applied on all elements, although some elements may have no effect on them.

<accesskey>, <class>, <contenteditable>, <contextmenu>, <data-*>, <dir>, <draggable>, <dropzone>, <hidden>, <id>, <lang>, <spellcheck>, <style>, <tabindex>, <title>, <translate>.

Learning with HTML Editor "Try it Now"

You can edit the HTML code and view the result using online editor.

Example

<object data="box.png" width="300" height="200"></object>
Try it Now »

Click on the "Try it Now" button to see how it works.


Sample Code

Copy each file contents and paste it to your own project and run to see the final output

Example

<object data="./index.jsp" width="500" height="300"></object>
Try it Now »

Click on the "Try it Now" button to see how it works.


Example

<object data="play.mp4" width="500" height="300"></object>
Try it Now »

Click on the "Try it Now" button to see how it works.