HTMLLinkElement: thuộc tính type

Baseline Widely available

This feature is well established and works across many devices and browser versions. It’s been available across browsers since July 2015.

Thuộc tính type của giao diện HTMLLinkElement là một chuỗi phản ánh MIME type">kiểu MIME của tài nguyên được liên kết.

Nó phản ánh thuộc tính type của phần tử <link>.

Giá trị

Một chuỗi, phải là một chuỗi kiểu MIME hợp lệ.

Ví dụ

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"

Đặc tả kỹ thuật

Thông số kỹ thuật
HTML
# dom-link-type

Trình duyệt hỗ trợ