HTML <object> data Attribute

The data attribute on an <object> tag specifies the URL or path of the resource to be embedded into the page.

Example

#

A data attribute on an <object> tag.
The attribute value specifies a pdf file.

PDF cannot be displayed.
<object data="/media/sample.pdf" type="application/pdf"
        style="width:100%;height:500px;">
   PDF cannot be displayed.
</object>

Using data

The data attribute specifies the URL or path of the resource file to be embedded into the page.

This attribute accepts any of these URLs:

  • internal URL - a resource on the same website or domain.
  • external URL - a resource on another website or domain

Syntax

<object data="URL">

Values

#

Value Description
URL URL or path of a resource.

Browser support

Here is when data support started for each browser:

Chrome
1.0 Sep 2008
Firefox
1.0 Sep 2002
IE/Edge
1.0 Aug 1995
Opera
1.0 Jan 2006
Safari
1.0 Jan 2003

You may also like

 Back to <object>
Guides