每個 HTML 元素在 DOM 中都對應一個特定的接口類型,繼承自 `HTMLElement` → `Element` → `Node` → `EventTarget`。理解這層映射,是精通原生 DOM 操作、編寫類型定義、開發 Web Components 的基礎。
| 標籤 | DOM 接口 | 關鍵屬性/方法 |
|---|---|---|
| `` | `HTMLHtmlElement` | `version`(廢棄) |
| `` | `HTMLHeadElement` | — |
| `` | `HTMLBodyElement` | `onload`、`onunload`、`onafterprint`、`onbeforeprint`、`onbeforeunload`、`onhashchange`、`onmessage`、`onoffline`、`ononline`、`onpagehide`、`onpageshow`、`onpopstate`、`onstorage` |
| ` | `HTMLTitleElement` | `text` |
| ` | `HTMLBaseElement` | `href`、`target` |
| `` | `HTMLLinkElement` | `href`、`rel`、`media`、`hreflang`、`type`、`sizes`、`crossorigin`、`referrerPolicy`、`as`、`integrity`、`fetchPriority`、`blocking` |
| `` | `HTMLMetaElement` | `name`、`content`、`httpEquiv`、`charset`、`media` |
| ` |