JavaScript and the DOM

Making a web page interactive

You can create a new element in JavaScript with document.createElement(), passing in the name of the HTML element you wanna create as a string.

Appending a node to the DOM is done with the appendChild() method. Call appendChild on the parent element and pass in the new childElement as an argument.

Remove elements from the page, using the removeChild() method on the parent element and passing in the item to remove.

Things that are purple: