This commit is contained in:
Ilya Kantor 2017-02-28 12:54:48 +03:00
parent 4272b7bb13
commit 508969c13f
168 changed files with 340 additions and 10 deletions

View file

@ -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`