📎아이템 55 DOM 계층 구조 이해하기
📍 DOM의 계층 구조
<p id="quote">and <i>yet</i> it moves</p>const p = document.getElementsByTagName('p')[0];
// ^? const p: HTMLParagraphElementEventTarget
function handleDrag(eDown: Event) {
const targetEl = eDown.currentTarget;
targetEl.classList.add('dragging');
// ~~~~~ 'targetEl' is possibly 'null'
// ~~~~~~~~~ Property 'classList' does not exist on type 'EventTarget'Node
Element와 HTMLElement
HTMLxxxElement
Event 타입의 계층 구조
📍 요약
Last updated