up
This commit is contained in:
parent
4272b7bb13
commit
508969c13f
168 changed files with 340 additions and 10 deletions
|
@ -0,0 +1,13 @@
|
|||
importance: 5
|
||||
|
||||
---
|
||||
|
||||
# createTextNode vs innerHTML vs textContent
|
||||
|
||||
We have an empty DOM element `elem` and a string `text`.
|
||||
|
||||
Which of these 3 commands do exactly the same?
|
||||
|
||||
1. `elem.append(document.createTextNode(text))`
|
||||
2. `elem.innerHTML = text`
|
||||
3. `elem.textContent = text`
|
Loading…
Add table
Add a link
Reference in a new issue