DOMImplementation.createDocumentType() - Web APIs 编辑
The DOMImplementation.createDocumentType()
method returns a DocumentType
object which can either be used with DOMImplementation.createDocument
upon document creation or can be put into the document via methods like Node.insertBefore()
or Node.replaceChild()
.
Syntax
var doctype = document.implementation.createDocumentType(qualifiedNameStr, publicId, systemId);
Parameters
qualifiedNameStr
- Is a
DOMString
containing the qualified name, likesvg:svg
.
publicId
- Is a
DOMString
containing thePUBLIC
identifier.
systemId
- Is a
DOMString
containing theSYSTEM
identifiers.
Example
var dt = document.implementation.createDocumentType('svg:svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');
var d = document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg:svg', dt);
alert(d.doctype.publicId); // -//W3C//DTD SVG 1.1//EN
Specifications
Browser compatibility
BCD tables only load in the browser
See also
- The
DOMImplementation
interface it belongs to.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论