Latest web development tutorials
 

Link type Property

< Link Object

Example

Return the MIME-type of the linked document:

var x = document.getElementById("myLink").type;

The result of x will be:

text/css
Try it Yourself »

Definition and Usage

The type property sets or returns the content type (MIME type) of the linked document.

Tip: Examples of MIME-types are: "text/css", "text/javascript", "image/gif", etc.


Browser Support

Internet Explorer Firefox Opera Google Chrome Safari

The type property is supported in all major browsers.


Syntax

Return the type property:

linkObject.type

Set the type property:

linkObject.type=MIME-type

Property Values

Value Description
MIME-type The MIME type of the linked document.
Look at IANA MIME types for a complete list of standard MIME types

Technical Details

Return Value: A String, representing the content type of the linked document

< Link Object