Anchor type Property
Anchor Object
Definition and Usage
The type property can set or return the MIME type of the linked resource.
The type attribute describes the MIME type of the linked document.
Syntax
Set the type attribute:
anchorObject.type="
MIME-type
"
Return the type attribute:
anchorObject.type
| Value | Description |
|---|---|
| MIME-type | Describes the MIME type of the linked document. For more about MIME types, see IANA MIME types |
Browser support





All major browsers support the type property.
Example
Example
The following example returns the MIME type of the linked resource:
<p>
<a id="runoob" type="text/html" href="//www.runoob.com">Runoob Tutorial
a
p
<
script
document.write("Returns the link's type attribute value:"); document.write(document.getElementById("runoob").type);
script
The example above produces the following output:
text/html
Try it »
Anchor Object