0
Create HTML element using JS
I’m wanting to make JS that creates a div tag when it is run I’ve done this a while back but I don’t have access to those files
5 Respostas
+ 4
Timmothy Rain
document.body.append(div);
+ 4
let div = document.createElement('div');
+ 3
and if you want it to be displayed, you need to insert it into the DOM
+ 3
just like in the example in the documentation
https://developer.mozilla.org/en-US/docs/Web/API/Document/createElement
+ 1
A͢J after creating the element how do i insert it into the html?