The HTML <object> type attribute
Quick answer
The HTML type attribute specifies the MIME type of the resource the object embeds. It is used on the <object> element.
Overview
The type attribute sets the MIME type of an embedded object. It is used on the <object> element.
It configures embedded content: what is embedded, what capabilities it is granted, and how it is sandboxed. With third-party content, these attributes are your main security controls.
Syntax
<object type="application/pdf" data="doc.pdf"></object>
Values
| Value |
|---|
A MIME type, e.g. application/pdf. |
Best practices
Frequently asked questions
What does the type attribute do?
Sets the MIME type of an embedded object.
How do I make an iframe secure?
How do I embed inline HTML in an iframe?
Which elements use the type attribute?
It is an element-specific attribute, used on the
<object> element.