zoukankan      html  css  js  c++  java
  • DocumentType类型

    <!DOCTYPE XML>
    <xml>
    	<head>
    		<meta charset="UTF-8">
    		<title>DocumentType类型</title>
    	</head>
    	<body>
    	</body>
    	<script>
    		/*
    		 nodeType 的值为 10;
     nodeName 的值为 doctype 的名称;
     nodeValue 的值为 null;
     parentNode 是 Document;
    不支持(没有)子节点。
    		 DocumentType 的 name 属性中保存的就是"HTML"
    		 在 DOM1 级中,DocumentType 对象不能动态创建,而只能通过解析文档代码的方式来创建。支
    持它的浏览器会把 DocumentType 对象保存在 document.doctype 中 。 DOM1 级描述了
    DocumentType 对象的 3 个属性:name、entities 和 notations。其中,name 表示文档类型的名称;
    entities 是由文档类型描述的实体的 NamedNodeMap 对象;notations 是由文档类型描述的符号的
    NamedNodeMap 对象。
    IE 及更早版本不支持 DocumentType,因此 document.doctype 的值始终都等于 null。可是,
    这些浏览器会把文档类型声明错误地解释为注释,并且为它创建一个注释节点。IE9 会 给
    document.doctype 赋正确的对象,但仍然不支持访问 DocumentType 类型。*/
    console.log(document.doctype.name); //xml
    		
    	</script>
    </xml>
    
  • 相关阅读:
    css换行
    VC include 路径解析 冷夜
    DirectxDraw学习笔记 冷夜
    winmain窗口代码 冷夜
    DirectDraw 常用功能代码记录 冷夜
    C/C++ 内存分配方式,堆区,栈区,new/delete/malloc/free 冷夜
    BMP文件结构 冷夜
    管道流
    打印流
    字符编码
  • 原文地址:https://www.cnblogs.com/gaoxuerong123/p/7803662.html
Copyright © 2011-2022 走看看