innerHTML vs appendChild()
Which approach is better?
9 min readMar 14, 2021
Both innerHTML
property and appendChild()
method can be used to add new contents to the page.
Differences between innerHTML
and appendChild()
Verbosity
innerHTML
is supposed to by assigned a HTML string, whereas appendChild()
accepts only Node
objects.