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

浏览器兼容性