You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
1.The content of `<body>` is replaced with the comment. The comment is `<!--BODY-->`, because`body.tagName == "BODY"`. As we remember, `tagName` is always uppercase in HTML.
16
-
2.The comment is now the only child node, so we get it in `body.firstChild`.
17
-
3.The `data`property of the comment is its contents (inside `<!--...-->`): `"BODY"`.
15
+
1.`<body>`의 콘텐츠가 `<!--BODY-->`로 대체됩니다.`body.tagName`은 `"BODY"`이기 때문입니다. `tagName`은 항상 대문자라는 점을 잊지 마세요.
16
+
2.`<body>`의 콘텐츠가 교체되면서 주석이 유일한 자식 노드가 됩니다. 따라서 `body.firstChild`을 사용해 주석을 얻을 수 있게 됩니다.
17
+
3.주석 노드의 `data`프로퍼티엔 주석 내용(`<!--...-->` 안쪽의 내용)이 저장됩니다. 따라서 `data` 프로퍼티의 값은 `"BODY"`입니다.
0 commit comments