HTML <object>
Published Mar 24, 2022Updated Jul 1, 2022
Contribute to Docs
The <object> element represents some resource external to the HTML document. This resource can be treated as an image, an embedded browsing context, or as content to be handled by a browser plugin.
Syntax
<object type="MIME type" data="URL of resource"></object>
The <object> element requires the following attributes to work properly:
- A
typeattribute that tells the browser what content media (MIME) type will be displayed. (“application/pdf”, “application/x-java-applet”, “audio/mp4”, etc.) - A
dataattribute that contains the URL to the resource being used.
This element may contain zero or more <param> elements to pass parameters on to the resource it is displaying:
<object type="MIME type" data="URL of resource"><param name="parameter name" value="parameter value" /></object>
Example
<objectwidth="420"height="315"type="video/mp4"data="https://www.youtube.com/v/138enunVlfs"></object>
Contribute to Docs
- Learn more about how to get involved.
- Edit this page on GitHub to fix an error or make an improvement.
- Submit feedback to let us know how we can improve Docs.
Learn HTML on Codecademy
- Front-end engineers work closely with designers to make websites beautiful, functional, and fast.
- Includes 34 Courses
- With Professional Certification
- Beginner Friendly.115 hours
- Start at the beginning by learning HTML basics — an important foundation for building and editing web pages.
- Beginner Friendly.7 hours