appendChild vs innerHTML: Best Practices for Safe and Efficient DOM Manipulation
When we are manipulating the DOM, sometimes we use innerHTML, so we can finish our work quickly, but did you know there is a better way and is best practice, namely using appendChild.
The following is the explanation.
Using appendChild is generally considered a better practice compared to using innerHTML.