HTML <object> Tag.
HTML <object> is a container for external resources.
➔ The best use and the objective of <object> element is to add browsers plug-ins.
➔ HTML has all media control elements to deal with each media types. <iframe>, <img>, <video> etc. So recommendation is to use these elements as a first priority.
Recommended alternatives are:
- Use the <img> tag for images.
- Use the <audio> tag for audio.
- Use the <video> tag for video.
- Use the <iframe> tag for embedding content.
HTML object tag example
The HTML object tag is used as a container to integrate external content such as audio, video, images, pdf files etc.
Note: Click play button to play the video.
Learning with HTML Editor "Try it Now"
You can edit the HTML code and view the result using online editor.
Example
<h4>Media in object</h4>
<div>
<object data="resources/media/seaside.mp4" type="video/mp4" width="500" height="300">
<p>Your browser does not support the.</p>
</object>
</div>
<h4>Document in object</h4>
<div>
<object type="text/html" data="./index.jsp" width="500" height="200" />
</div>
Click on the "Try it Now" button to see how it works.