1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
---
title: HTMLDocument
slug: Web/API/HTMLDocument
translation_of: Web/API/HTMLDocument
---
<p style="margin: 0px 0px 24px; padding: 0px; border: 0px; color: rgb(77, 78, 83); font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);">{{ APIRef("HTML DOM") }}</p>
<p style="margin: 0px 0px 24px; padding: 0px; border: 0px; color: rgb(77, 78, 83); font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);"><strong style="border: 0px; margin: 0px; padding: 0px;"><code style="margin: 0px; padding: 0px; border: 0px; font-style: inherit; font-weight: inherit; font-family: Courier, 'Andale Mono', monospace;">HTMLDocument</code></strong> 是 <a href="/zh-CN/docs/Web/API/Document_Object_Model" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 149, 221); text-decoration: none;">DOM</a> 的一个抽象接口,它提供了 XML 文档里没有出现的特殊属性和方法。</p>
<p style="margin: 0px 0px 24px; padding: 0px; border: 0px; color: rgb(77, 78, 83); font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);">它的属性和方法包含在 {{domxref("Document")}} 接口页面中,并且每个属性和方法都分成小节进行了介绍。</p>
<p style="margin: 0px 0px 24px; padding: 0px; border: 0px; color: rgb(77, 78, 83); font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);">HTMLDocument 对象继承了 Document 接口和 HTMLDocument 接口。因此它有比 Document 更多的属性。并且与 XMLDocument 不同的是,HTMLDocument 是具有外观的,并且要管理它后代的 HTMLElement。</p>
<h2 id="规范">规范</h2>
<table class="standard-table">
<tbody>
<tr>
<td>{{SpecName('DOM1','level-one-html.html#ID-26809268','HTMLDocument')}}</td>
<td>{{Spec2('DOM1')}}</td>
<td>Initial definition for the interface</td>
</tr>
<tr>
<td>{{SpecName('DOM2 HTML','html.html#ID-26809268','HTMLDocument')}}</td>
<td>{{Spec2('DOM2 HTML')}}</td>
<td>Supersede DOM 1</td>
</tr>
<tr>
<td>{{SpecName('HTML WHATWG','dom.html#the-document-object','Document')}}</td>
<td>{{Spec2('HTML WHATWG')}}</td>
<td>Turn the <code>HTMLDocument</code> interface into a {{domxref("Document")}} extension.</td>
</tr>
</tbody>
</table>
<ul style="margin: 0px 0px 24px; padding: 0px 0px 0px 40px; border: 0px; color: rgb(77, 78, 83); font-family: 'Open Sans', Arial, sans-serif; font-size: 14px; line-height: 21px; background-color: rgb(255, 255, 255);">
<li style="margin: 0px 0px 6px; padding: 0px; border: 0px;"><a class="external external-icon" href="http://www.w3.org/TR/DOM-Level-2-HTML/html.html#ID-26809268" rel="freelink" style="margin: 0px; padding: 0px; border: 0px; color: rgb(0, 149, 221); text-decoration: none; white-space: pre-line;">http://www.w3.org/TR/DOM-Level-2-HTM...ml#ID-26809268</a></li>
</ul>
|