Easy Tutorial
❮ Prop Keygen Autofocus Met Canvas Measuretext ❯

Link type Attribute


Definition and Usage

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

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

Syntax

To set the type attribute:

To return the type attribute:


Browser Support

All major browsers support the type attribute.


Example

Display the MIME type of the linked document:

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>tutorialpro.org(tutorialpro.org)</title>
<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 the MIME type of the link element</button>

</body>
</html>

❮ Prop Keygen Autofocus Met Canvas Measuretext ❯