HTMLLinkElement: type 属性
HTMLLinkElement 接口的 type 属性是一个字符串,表示链接资源的 MIME 类型。
它反映了 <link> 元素的 type 属性。
值
一个字符串,必须是有效的 MIME 类型字符串。
示例
html
<link
id="el"
rel="apple-touch-icon"
sizes="114x114"
href="apple-icon-114.png"
type="image/png" />
js
const el = document.getElementById("el");
console.log(el.type); // Output: "image/png"
规范
| 规范 |
|---|
| HTML # dom-link-type |
浏览器兼容性
加载中…