HTML

HTMLObjectElement

HTMLObjectElement <object>

Special features and methods for modifying the organization and display of the <object> element, which represents external resources, are provided by the HTMLObjectElement interface.

An external resource's container is defined by the <object> tag. A web page, a photograph, a media player, or a plug-in program can all be considered external resources.

Attribute Value Description Example
data URL Specifies the URL of the resource to be used by the object <object data="pic_trulli.jpg" width="300" height="200"</object>
height pixels Specifies the height of the object <object data="pic_trulli.jpg" height="300" width="200"></object>
name name Specifies a name for the object <object data="pic_trulli.jpg" width="300" height="200" name="obj1"></object>
type media_type Specifies the media type of data specified in the data attribute <object data="pic_trulli.jpg" type="image/jpg" width="400" height="400"></object>
typemustmatch true/false Specifies whether the type attribute and the actual content of the resource must match to be displayed
width pixels Specifies the width of the object <object data="pic_trulli.jpg" width="200" height="300"></object>

Browser Compatibility

Element Chrome Edge Firefox Safari Opera
<object> Yes Yes Yes Yes Yes