Anchor typeProperty
Anchor Object
Definition and Usage
The type property sets or returns the MIME type of the linked resource.
The type property describes the MIME type of the linked document.
Syntax
Set the type property:
anchorObject.type="MIME-type"
Return the type property:
anchorObject.type
| Value | Description |
|---|---|
| MIME-type | Describes the MIME type of the linked document. For more information on MIME types, seeIANA MIME types |
Browser Support
![]()
![]()
![]()
![]()
![]()
All major browsers support the type property
Examples
Examples
The following example returns the MIME type of the linked resource:
<p><a id="example" type="text/html" href="//www.example.com">Example</a></p>
<script>document.write("Return the link's type attribute value:");
document.write(document.getElementById("example").type);</script>
The output of the above example is:
text/html
Try it Yourself »
Anchor Object Other Extensions