From b011d59119a3a05aaadccf3147c956ed52533a3f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=87=E9=BE=99?= <2717752887@qq.com> Date: Mon, 21 Nov 2022 03:38:03 +0000 Subject: [PATCH 1/3] =?UTF-8?q?2022-11.18=E7=AC=AC=E5=8D=81=E5=85=AB?= =?UTF-8?q?=E6=AC=A1=E4=BD=9C=E4=B8=9A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴文龙 <2717752887@qq.com> --- ...346\254\241\344\275\234\344\270\2321.html" | 38 +++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 "17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022_11.18\347\254\254\345\215\201\345\205\253\346\254\241\344\275\234\344\270\2321.html" diff --git "a/17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022_11.18\347\254\254\345\215\201\345\205\253\346\254\241\344\275\234\344\270\2321.html" "b/17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022_11.18\347\254\254\345\215\201\345\205\253\346\254\241\344\275\234\344\270\2321.html" new file mode 100644 index 0000000..df95075 --- /dev/null +++ "b/17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022_11.18\347\254\254\345\215\201\345\205\253\346\254\241\344\275\234\344\270\2321.html" @@ -0,0 +1,38 @@ + + + + + + + Document + + + +   + +
+
+ + + + + + + \ No newline at end of file -- Gitee From 0faee430082178740110bdec846dc0cedb4ad944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=87=E9=BE=99?= <2717752887@qq.com> Date: Mon, 21 Nov 2022 03:38:25 +0000 Subject: [PATCH 2/3] =?UTF-8?q?2022-11.18=E7=AC=AC=E5=8D=81=E5=85=AB?= =?UTF-8?q?=E6=AC=A1=E4=BD=9C=E4=B8=9A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴文龙 <2717752887@qq.com> --- ...346\254\241\344\275\234\344\270\2322.html" | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 "17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022_11.18\347\254\254\345\215\201\345\205\253\346\254\241\344\275\234\344\270\2322.html" diff --git "a/17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022_11.18\347\254\254\345\215\201\345\205\253\346\254\241\344\275\234\344\270\2322.html" "b/17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022_11.18\347\254\254\345\215\201\345\205\253\346\254\241\344\275\234\344\270\2322.html" new file mode 100644 index 0000000..180b6d6 --- /dev/null +++ "b/17\345\220\264\346\226\207\351\276\231/\344\275\234\344\270\232/2022_11.18\347\254\254\345\215\201\345\205\253\346\254\241\344\275\234\344\270\2322.html" @@ -0,0 +1,29 @@ + + + + + + + Document + + + + + + + + + + + \ No newline at end of file -- Gitee From 97c06eb0a185c77057d42e1f68aecefac08b450b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=96=87=E9=BE=99?= <2717752887@qq.com> Date: Mon, 21 Nov 2022 03:38:47 +0000 Subject: [PATCH 3/3] =?UTF-8?q?2022-11.18=E7=AC=AC=E5=8D=81=E5=85=AB?= =?UTF-8?q?=E6=AC=A1=E7=AC=94=E8=AE=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴文龙 <2717752887@qq.com> --- ...53\346\254\241\347\254\224\350\256\260.md" | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 "17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-11.18\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" diff --git "a/17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-11.18\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" "b/17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-11.18\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" new file mode 100644 index 0000000..751d099 --- /dev/null +++ "b/17\345\220\264\346\226\207\351\276\231/\347\254\224\350\256\260/2022-11.18\347\254\254\345\215\201\345\205\253\346\254\241\347\254\224\350\256\260.md" @@ -0,0 +1,65 @@ +## DOM(文档对象模型) + +Document 对象 +当浏览器加载一个 HTML 文档时,会创建一个 Document 对象,Document 对象是 DOM 树中所有节点的根节点。通过 Document 对象我们可以访问 HTML 文档中的所有元素。 +提示:Document 对象是 Window 对象的一部分,所以您可以通过 window.document 来访问 Document 对象。 + +Dom节点常见的只有三种:分别是元素节点,属性节点,文本节点。我们可以用nodeType值来判断节点的类型,它们对应的nodeType属性值分别是1,2,3 + +## Document 对象中的属性 + +| 属性 | 描述 | +| ---------------------------- | ------------------------------------------------------------ | +| document.activeElement | 返回当前获取焦点的元素 | +| document.anchors | 返回对文档中所有 Anchor 对象的引用 | +| document.applets | 返回对文档中所有 Applet 对象的引用。注意: HTML5 已不支持 元素 | +| document.baseURI | 返回文档的基础 URI | +| document.body | 返回文档的 body 元素 | +| document.cookie | 设置或返回与当前文档有关的所有 cookie | +| document.doctype | 返回与文档相关的文档类型声明 (DTD) | +| document.documentElement | 返回文档的根节点 | +| document.documentMode | 返回浏览器渲染文档的模式 | +| document.documentURI | 设置或返回文档的位置 | +| document.domain | 返回当前文档的域名 | +| document.domConfig | 已废弃,返回 normalizeDocument() 被调用时所使用的配置 | +| document.embeds | 返回文档中所有嵌入内容(embed)的集合 | +| document.forms | 返回文档中所有 Form 对象的引用 | +| document.images | 返回文档中所有 Image 对象的引用 | +| document.implementation | 返回处理该文档的 DOMImplementation 对象 | +| document.inputEncoding | 返回文档的编码方式 | +| document.lastModified | 返回文档的最后修改日期 | +| document.links | 返回对文档中所有 Area 和 Link 对象的引用 | +| document.readyState | 返回文档状态(载入中) | +| document.referrer | 返回载入当前文档的 URL | +| document.scripts | 返回页面中所有脚本的集合 | +| document.strictErrorChecking | 设置或返回是否强制进行错误检查 | +| document.title | 返回当前文档的标题 | +| document.URL | 返回文档的完整 URL | + +## Document 对象中的方法 + +| 方法 | 描述 | +| --------------------------------- | ------------------------------------------------------------ | +| document.addEventListener() | 向文档中添加事件 | +| document.adoptNode(node) | 从另外一个文档返回 adapded 节点到当前文档 | +| document.close() | 关闭使用 document.open() 方法打开的输出流,并显示选定的数据 | +| document.createAttribute() | 为指定标签添加一个属性节点 | +| document.createComment() | 创建一个注释节点 | +| document.createDocumentFragment() | 创建空的 DocumentFragment 对象,并返回此对象 | +| document.createElement() | 创建一个元素节点 | +| document.createTextNode() | 创建一个文本节点 | +| document.getElementsByClassName() | 返回文档中所有具有指定类名的元素集合 | +| document.getElementById() | 返回文档中具有指定 id 属性的元素 | +| document.getElementsByName() | 返回具有指定 name 属性的对象集合 | +| document.getElementsByTagName() | 返回具有指定标签名的对象集合 | +| document.importNode() | 把一个节点从另一个文档复制到该文档以便应用 | +| document.normalize() | 删除空文本节点,并合并相邻的文本节点 | +| document.normalizeDocument() | 删除空文本节点,并合并相邻的节点 | +| document.open() | 打开一个流,以收集来自 document.write() 或 document.writeln() 方法的输出 | +| document.querySelector() | 返回文档中具有指定 CSS 选择器的第一个元素 | +| document.querySelectorAll() | 返回文档中具有指定 CSS 选择器的所有元素 | +| document.removeEventListener() | 移除文档中的事件句柄 | +| document.renameNode() | 重命名元素或者属性节点 | +| document.write() | 向文档中写入某些内容 | +| document.writeln() | 等同于 write() 方法,不同的是 writeln() 方法会在末尾输出一个换行符 | + -- Gitee