--- id: javascript-html-dom title: "JavaScript HTML DOM" category: "Frontend" status: "draft" verification_status: "conceptual" canonical_id: "" aliases: ["HTML DOM", "Document Object Model", "DOM tree", "DOM nodes", "HTML Document Object Model"] duplicate_of: "" source_trust_level: "B" confidence_score: 0.88 created_at: 2026-06-23 updated_at: 2026-06-23 review_reason: "" merge_history: [] tags: ["javascript", "js", "web", "frontend", "w3schools", "dom"] raw_sources: ["https://www.w3schools.com/js/js_htmldom.asp"] applied_in: [] github_commit: "" --- # [[JavaScript HTML DOM]] ## 🎯 ν•œ 쀄 톡찰 (One-line insight) The HTML DOM is an object model that represents an HTML page as a tree of nodes, giving JavaScript a standardized way to access and change every element on the page. [S1] ## 🧠 핡심 κ°œλ… (Core concepts) - **The HTML DOM is an Object Model for HTML Documents** β€” it represents an HTML page as a tree of nodes. [S1] - **The browser builds the tree on load** β€” when a webpage loads, the browser creates a tree-like representation of the document made of nodes: Document, Element nodes (such as ``, ``, ``), Attribute nodes, and Text nodes. [S1] - **Three roles in one access expression** β€” `id="demo"` is an HTML property, `getElementById()` is a DOM method, and `innerHTML` is a DOM property. [S1] - **The DOM is a W3C Standard** β€” defined by the World Wide Web Consortium in three parts: Core DOM, XML DOM, and HTML DOM. [S1] ## 🧩 μΆ”μΆœλœ νŒ¨ν„΄ (Extracted patterns) - **Access then modify** β€” get a node reference with a DOM method, then read or write a DOM property on it. [S1] - **Tree traversal mindset** β€” because the page is a tree of nodes, navigation and manipulation are expressed in terms of elements, attributes, and text nodes. [S1] ## πŸ“– μ„ΈλΆ€ λ‚΄μš© (Details) **The HTML DOM** [S1] The HTML DOM (HTML Document Object Model) is an Object Model for HTML Documents. It represents an HTML page as a tree of nodes. [S1] **The DOM Tree** [S1] When a webpage loads, the browser creates a tree-like representation of the document. This tree is made of nodes for the different parts of the document: the Document node, Element nodes (for example ``, ``, ``), Attribute nodes, and Text nodes. [S1] **Accessing HTML Elements** [S1] HTML elements are accessed through the document. The following example accesses a paragraph element by its id and changes its content: [S1] ```javascript // Access a paragraph Element const myPara = document.getElementById("demo"); // Change the content of the Element myPara.innerHTML = "Hello World!"; ``` In this example, `id="demo"` is an HTML property, `getElementById()` is a DOM method, and `innerHTML` is a DOM property. [S1] **What You Will Learn** [S1] The tutorial covers how to: change the content of HTML elements, change the style (CSS) of HTML elements, add and delete HTML elements, and react to HTML events. [S1] **The World Wide Web Consortium** [S1] The DOM is a W3C Standard (World Wide Web Consortium). The W3C DOM standard is separated into three parts: Core DOM, XML DOM, and HTML DOM. [S1] ## πŸ› οΈ 적용 사둀 (Applied in summary) The page's own snippet β€” selecting `#demo` with `getElementById()` and assigning to `innerHTML` β€” is the canonical applied example. No external project/commit applications found in the source. ## πŸ’» μ½”λ“œ νŒ¨ν„΄ (Code patterns) Access an element by id and change its content (language: JavaScript): ```javascript const myPara = document.getElementById("demo"); myPara.innerHTML = "Hello World!"; ``` ## βš–οΈ λͺ¨μˆœ 및 μ—…λ°μ΄νŠΈ (Contradictions & updates) No contradictions found in the source. ## βœ… 검증 μƒνƒœ 및 신뒰도 - **μƒνƒœ:** draft - **검증 단계:** conceptual (μ‹€μ œ 적용 사둀 발견 μ‹œ applied/validated둜 승격 κ°€λŠ₯) - **좜처 신뒰도:** B (W3Schools β€” widely used educational reference, not a primary standards body) - **μ‹ λ’° 점수:** 0.88 - **쀑볡 검사 κ²°κ³Ό:** μ‹ κ·œ 생성 (New discovery) ## πŸ”— 지식 κ·Έλž˜ν”„ (Knowledge Graph) - **μƒμœ„/루트:** [[JavaScript Tutorial]] - **κ΄€λ ¨ κ°œλ…:** [[JavaScript DOM Methods]], [[JavaScript DOM Elements]], [[JavaScript DOM Changing HTML]], [[JavaScript Introduction]] - **μ°Έμ‘° λ§₯락:** The foundational model referenced by every DOM manipulation, styling, and event topic. ## πŸ“š 좜처 (Sources) - [S1] W3Schools β€” JavaScript HTML DOM β€” https://www.w3schools.com/js/js_htmldom.asp ## πŸ“ λ³€κ²½ 이λ ₯ (Change history) - 2026-06-23: Initial draft synthesized from the W3Schools "JavaScript HTML DOM" page (Astra wiki-curation, P-Reinforce v3.1 format).