Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

HTML DOM Anchor type Property

Anchor type Property

Anchor Object Reference 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

Internet ExplorerFirefoxOperaGoogle ChromeSafari

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 Reference Anchor Object