How to run a class in html and javascript?
MatthewX (144)

How do I run <div class = ""></div> when a button is pressed?

You are viewing a single comment. View All
Answered by Coder100 (8646) [earned 5 cycles]
View Answer
Coder100 (8646)
let newItem = document.createElement("li");
let tag = document.getElementById("tag");
tag.appendChild(newItem);
<ol id="tag"></ol>

https://www.w3schools.com/jsref/met_node_appendchild.asp
@MatthewX