Link type Property
Link Object
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.
Syntax
Set the type property:
linkObject.type="MIME-type"
Return the type property:
Browser Support

The type property is supported in all major browsers.
Example
Example
Display the MIME-type of the linked document:
<html>
<head>
<link id="link1" rel="stylesheet" type="text/css" href="style1.css">
<script>
function displayResult()
{
var x=document.getElementById("link1").type;
alert(x);
}
</script>
</head>
<body>
<button type="button" onclick="displayResult()">Display MIME-type</button>
</body>
</html>
Try it yourself »
Link Object
Thank You For Helping Us!
Your message has been sent to W3Schools.
Close [X]