Skip to main content Accessibility Feedback

DOM Injection

document.createElement()

Create an element. Pass in the element to create, without angled brackets (<>), as an argument

let div = document.createElement('div');
let link = document.createElement('a');
let article = document.createElement('article');

Find this useful? You can support my work by purchasing an annual membership.