Course
summary


    0 chapters available

Loading...

Make your website interactive with JavaScript

Difficulty: Beginner ● Progress: 0 / 0 modules completed

Create a new HTML element

Injecting an element into the page is done in three steps: first, we create the element in question, then we configure it, and finally we inject it at the desired location.

To create an element, we logically use the createElement method, present in the document object, like this:

let myElement = document.createElement("p");

You need a free account to read this module