DocumentType: systemId 屬性

Baseline 已廣泛支援

此特性已相當成熟,可在許多裝置和瀏覽器版本上使用。自 ⁨2015 年 7 月⁩以來,各瀏覽器均已提供此特性。

DocumentType 的只讀屬性 systemId 返回關聯 DTD 的 URL。

對於人工(synthetic)建立的 DocumentType,此屬性反映在 DOMImplementation.createDocumentType() 中作為引數傳入的值。

字串。

示例

js
const docType = document.implementation.createDocumentType(
  "svg",
  "",
  "http://www.w3.org/2000/svg",
);

console.log(docType.systemId); // Displays "http://www.w3.org/2000/svg"

規範

規範
DOM
# dom-documenttype-systemid

瀏覽器相容性