Manipulate DOM programatically
by Wentz Wu
JavaScript
var elem = document.createElement("h1");
elem.textContent = "Hello";
elem.style.color = "red";
elem.addEventListener("click",function(e){ alert("hello"); });
document.body.appendChild(elem);
by Wentz Wu
var elem = document.createElement("h1");
elem.textContent = "Hello";
elem.style.color = "red";
elem.addEventListener("click",function(e){ alert("hello"); });
document.body.appendChild(elem);