DocumentType:publicId 属性
Baseline
Widely available
This feature is well established and works across many devices and browser versions. It’s been available across browsers since 2015年7月.
DocumentType 的 publicId 只读属性返回文档的形式化标识符。
对于合成的 DocumentType,此属性将反映 DOMImplementation.createDocumentType() 参数中给出的值。
值
字符串。
示例
js
const docType = document.implementation.createDocumentType(
"svg",
"-//W3C//DTD SVG 1.1//EN",
"http://www.w3.org/2000/svg",
);
console.log(docType.publicId); // 显示“-//W3C//DTD SVG 1.1//EN”
规范
| Specification |
|---|
| DOM> # dom-documenttype-publicid> |
浏览器兼容性
Loading…