DocumentType:publicId 屬性
DocumentType 介面的只讀屬性 publicId 返回文件的正式識別符號。
對於人工(synthetic)建立的 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); // Displays "-//W3C//DTD SVG 1.1//EN"
規範
| 規範 |
|---|
| DOM # dom-documenttype-publicid |
瀏覽器相容性
載入中…