Link type attribute
Definition and Usage
type
Set or return the content type (MIME type) of the linked document.
Tip:Examples of MIME types include: "text/css", "text/javascript", "image/gif", etc.
See also:
HTML Reference Manual:HTML <link> type 属性
HTML Reference Manual:HTML <link> 标签
Example
Return the MIME type of the linked document:
var x = document.getElementById("myLink").type;
Syntax
Return type attribute:
linkObject.type
Set type attribute:
linkObject.type = MIME-type
属性值
值 | 描述 |
---|---|
MIME-type |
|
技术细节
返回值: | 字符串值,表示链接文档的内容类型。 |
---|
浏览器支持
Chrome | Edge | Firefox | Safari | Opera |
---|---|---|---|---|
Chrome | Edge | Firefox | Safari | Opera |
支持 | 支持 | 支持 | 支持 | 支持 |