innerHTML vs appendChild()

Which approach is better?

Marian Čaikovski

--

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.

--

--

Marian Čaikovski

Java, JavaScript and SQL developer. Interested in data collection and visualization.