Dofactory.com
Dofactory.com
Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

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.

The resource may came from the same or another website.

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>

Last updated on Sep 30, 2023

Earn income with your HTML skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

Guides