dom-hierarchy

Installation
SKILL.md

Understand the DOM Hierarchy

Overview

TypeScript's DOM types accurately model the browser's DOM hierarchy. Understanding this hierarchy - Element extends Node, HTMLElement extends Element, etc. - helps you write correct DOM code. Use the most specific type possible for better autocompletion and type safety.

When to Use This Skill

  • Working with DOM APIs
  • Typing element references
  • Creating DOM utilities
  • Handling DOM events
  • Manipulating the DOM

The Iron Rule

Use the most specific DOM type possible. HTMLElement for HTML elements, HTMLInputElement for inputs, etc.

DOM Type Hierarchy

Related skills
Installs
10
GitHub Stars
2
First Seen
Feb 3, 2026