Open In App

HTML data Attribute

Last Updated : 28 Aug, 2024
Comments
Improve
Suggest changes
Like Article
Like
Report

The HTML data Attribute is used to specify the URL of the Embedded file of the Object. It can be used with the <object> element. 
Syntax: 
 

<object data="URL">

Attribute Values: It contains a single value URL which is used to specify the source of the object.

The possible values of URL are:

  • absolute URL: It points to another website.
  • relative URL: It points to a file within a website.

Example: This Example illustrates the use of the data Attribute. 

html
<!DOCTYPE html>
<html>

<head>
    <title>HTML data Attribute</title>
</head>

<body>
    <center>
        <h1>HTML data Attribute</h1>
        <br>
    </center>

    <object data=
"https://www.geeksforgeeks.org/wp-content/uploads/Geek_logi_-low_res.png"
            width="550px"
            height="150px">
      GeeksforGeeks
  </object>

</body>

</html>

Output: 
 


Supported Browsers: The browser supported by HTML data Attribute are listed below: 


Next Article

Similar Reads