Creating DOM Elements

One of the most common uses for JavaScript is to create HTML. Creating HTML with JavaScript can involve creating a single tag or the entire page. There are common ways to create HTML. One is to use the createElement() function. The other is to use an HTML string with innerHTML property or the insertAdjacentHTML() method.