Skip to content
Related Articles

Related Articles

Save Article
Improve Article
Save Article
Like Article

How to specify URL of resource to be used by the object in HTML5 ?

  • Last Updated : 13 Apr, 2021

In this article, we will cover how to specify the URL of the resource to be used by the object in HTML5. It can be used in pages where content from an external source is required.

It can be done by setting the data attribute to the specified URL in the <object> tag.

Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.

Syntax:

<object data="URL">

Possible Values 



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

Example:

HTML




<!DOCTYPE html>
<html>
  
<body>
    <h4 style="color: green;">
        GeeksforGeeks
    </h4>
  
    <p>Object with an URL of the image:</p>
  
    <object data=
    </object>
</body>
  
</html>

Output:

My Personal Notes arrow_drop_up
Recommended Articles
Page :