Skip to content

Commit 3c1628d

Browse files
ss-wondvlprsh
andauthored
Update pages/tutorials/dom-manipulation.md
Co-authored-by: Seohee Park <[email protected]>
1 parent c3eae9f commit 3c1628d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

β€Žpages/tutorials/dom-manipulation.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ TypeScript μ½”λ“œμ˜ 첫 번째 쀄은 μ „μ—­λ³€μˆ˜ `document`λ₯Ό μ‚¬μš©ν•˜λ©°,
6767
getElementById(elementId: string): HTMLElement | null;
6868
```
6969

70-
λ¬Έμžμ—΄ id μš”μ†Œκ°€ μ „λ‹¬λ˜λ©΄ `HTMLElement` λ˜λŠ” `null`이 λ°˜ν™˜λ©λ‹ˆλ‹€. 이 λ©”μ„œλ“œλŠ” κ°€μž₯ μ€‘μš”ν•œ μœ ν˜•λ“€ 쀑 ν•˜λ‚˜μΈ `HTMLElement`λ₯Ό λ„μž…ν•©λ‹ˆλ‹€. 이 μœ ν˜•μ€ λ‹€λ₯Έ λͺ¨λ“  μš”μ†Œ μΈν„°νŽ˜μ΄μŠ€μ˜ κΈ°λ³Έ μΈν„°νŽ˜μ΄μŠ€ 역할을 ν•©λ‹ˆλ‹€. 예λ₯Ό λ“€λ©΄, 예제 μ½”λ“œμ—μ„œ `p` λ³€μˆ˜λŠ” `HTMLParagraphElement` μœ ν˜•μž…λ‹ˆλ‹€. λ‹€μŒμœΌλ‘œ, 이 λ©”μ„œλ“œλŠ” `null`을 λ°˜ν™˜ν•  수 μžˆλ‹€λŠ” 점에 μœ μ˜ν•΄μ•Ό ν•©λ‹ˆλ‹€. λ©”μ„œλ“œκ°€ μ‹€μ œλ‘œ μ§€μ •λœ μš”μ†Œλ₯Ό 찾을 수 μžˆμ„μ§€ 없을지에 따라 ν™•μ‹€ν•œ 사전 λŸ°νƒ€μž„μ΄ 될 수 μ—†κΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€. μŠ€λ‹ˆνŽ« μ½”λ“œμ˜ λ§ˆμ§€λ§‰ μ€„μ—λŠ”, `appendChild`λ₯Ό ν˜ΈμΆœν•˜κΈ° μœ„ν•΄ μƒˆλ‘œμš΄ _optional chaining_ μ—°μ‚°μžκ°€ μ‚¬μš©λ˜κ³  μžˆμŠ΅λ‹ˆλ‹€.
70+
λ¬Έμžμ—΄ id μš”μ†Œκ°€ μ „λ‹¬λ˜λ©΄ `HTMLElement` λ˜λŠ” `null`이 λ°˜ν™˜λ©λ‹ˆλ‹€. 이 λ©”μ„œλ“œλŠ” κ°€μž₯ μ€‘μš”ν•œ νƒ€μž… 쀑 ν•˜λ‚˜μΈ `HTMLElement`λ₯Ό λ„μž…ν•©λ‹ˆλ‹€. 이 μœ ν˜•μ€ λ‹€λ₯Έ λͺ¨λ“  μš”μ†Œ μΈν„°νŽ˜μ΄μŠ€μ˜ κΈ°λ³Έ μΈν„°νŽ˜μ΄μŠ€ 역할을 ν•©λ‹ˆλ‹€. 예λ₯Ό λ“€λ©΄, 예제 μ½”λ“œμ—μ„œ `p` λ³€μˆ˜λŠ” `HTMLParagraphElement` νƒ€μž…μž…λ‹ˆλ‹€. λ‹€μŒμœΌλ‘œ, 이 λ©”μ„œλ“œλŠ” `null`을 λ°˜ν™˜ν•  수 μžˆλ‹€λŠ” 점에 μœ μ˜ν•΄μ•Ό ν•©λ‹ˆλ‹€. λ©”μ„œλ“œκ°€ μ‹€μ œλ‘œ μ§€μ •λœ μš”μ†Œλ₯Ό 찾을 수 μžˆμ„μ§€ 없을지에 따라 ν™•μ‹€ν•œ 사전 λŸ°νƒ€μž„μ΄ 될 수 μ—†κΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€. μŠ€λ‹ˆνŽ« μ½”λ“œμ˜ λ§ˆμ§€λ§‰ μ€„μ—λŠ”, `appendChild`λ₯Ό ν˜ΈμΆœν•˜κΈ° μœ„ν•΄ μƒˆλ‘œμš΄ _optional chaining_ μ—°μ‚°μžκ°€ μ‚¬μš©λ˜κ³  μžˆμŠ΅λ‹ˆλ‹€.
7171

7272
### `Document.createElement`
7373

@@ -197,4 +197,4 @@ The best part about the _lib.dom.d.ts_ type definitions is that they are reflect
197197
Sources:
198198
199199
* [ECMA-262 Standard](http://www.ecma-international.org/ecma-262/10.0/index.html)
200-
* [Introduction to the DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model/Introduction)
200+
* [Introduction to the DOM](https://developer.mozilla.org/docs/Web/API/Document_Object_Model/Introduction)

0 commit comments

Comments
Β (0)