Skip to content

Commit 50c38e6

Browse files
[DOM 탐색하기] 과제 번역
- 충북대학교 git/GitHub 실습용 - 이슈 #474
1 parent 0b0c678 commit 50c38e6

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,27 @@
1-
There are many ways, for instance:
1+
방법은 다양합니다.
22

33

4-
The `<div>` DOM node:
4+
`<div>` DOM 노드:
55

66
```js
77
document.body.firstElementChild
8-
// or
8+
// 또는
99
document.body.children[0]
10-
// or (the first node is space, so we take 2nd)
10+
// 또는 (첫 번째 노드는 공백이므로 두 번째 노드를 가져옴)
1111
document.body.childNodes[1]
1212
```
1313

14-
The `<ul>` DOM node:
14+
`<ul>` DOM 노드:
1515

1616
```js
1717
document.body.lastElementChild
18-
// or
18+
// 또는
1919
document.body.children[1]
2020
```
2121

22-
The second `<li>` (with Pete):
22+
두 번째 `<li>` (Pete):
2323

2424
```js
25-
// get <ul>, and then get its last element child
25+
// <ul>을 가져오고, <ul>의 마지막 자식 요소를 가져옴
2626
document.body.lastElementChild.lastElementChild
2727
```

2-ui/1-document/03-dom-navigation/1-dom-children/task.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@ importance: 5
22

33
---
44

5-
# DOM children
5+
# 자식 DOM
66

7-
Look at this page:
7+
아래 페이지를 살펴봅시다.
88

99
```html
1010
<html>
1111
<body>
12-
<div>Users:</div>
12+
<div>사용자:</div>
1313
<ul>
1414
<li>John</li>
1515
<li>Pete</li>
@@ -18,7 +18,7 @@ Look at this page:
1818
</html>
1919
```
2020

21-
For each of the following, give at least one way of how to access them:
22-
- The `<div>` DOM node?
23-
- The `<ul>` DOM node?
24-
- The second `<li>` (with Pete)?
21+
아래 DOM 노드에 접근할 방법을 최소 한 가지 이상씩 생각해보세요.
22+
- `<div>` DOM 노드
23+
- `<ul>` DOM 노드
24+
- 두 번째 `<li>` (Pete)
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
1. Yes, true. The element `elem.lastChild` is always the last one, it has no `nextSibling`.
2-
2. No, wrong, because `elem.children[0]` is the first child *among elements*. But there may exist non-element nodes before it. So `previousSibling` may be a text node.
1+
1. 네 맞습니다. `elem.lastChild`는 항상 마지막 노드이기 때문에 `nextSibling`이 없습니다.
2+
2. 아닙니다. `elem.children[0]`*요소 노드 중* 첫 번째 자식 노드를 나타내기 때문입니다. 이 앞에 요소 노드가 아닌 다른 노드가 올 수도 있습니다. `previousSibling`은 텍스트 노드가 될 수도 있습니다.
33

4-
Please note: for both cases if there are no children, then there will be an error.
4+
주의 사항: 두 경우 모두 자식 노드가 없는 경우 에러가 발생합니다.
55

6-
If there are no children, `elem.lastChild` is `null`, so we can't access `elem.lastChild.nextSibling`. And the collection `elem.children` is empty (like an empty array `[]`).
6+
자식 노드가 없으면 `elem.lastChild``null`이 되기 때문에 `elem.lastChild.nextSibling`에 접근할 수 없습니다. 그리고 컬렉션 `elem.children`은 빈 배열 `[]`같이 빈 상태가 됩니다.

2-ui/1-document/03-dom-navigation/3-navigation-links-which-null/task.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ importance: 5
22

33
---
44

5-
# The sibling question
5+
# 형제 노드에 관한 질문
66

7-
If `elem` -- is an arbitrary DOM element node...
7+
임의의 DOM 요소 노드 `elem`이 있다고 가정해봅시다.
88

9-
- Is it true that `elem.lastChild.nextSibling` is always `null`?
10-
- Is it true that `elem.children[0].previousSibling` is always `null` ?
9+
- `elem.lastChild.nextSibling`은 항상 `null`일까요?
10+
- `elem.children[0].previousSibling`은 항상 `null`일까요?

0 commit comments

Comments
 (0)