Answers for "document.createElement(nodename) a class"

6

create element javascript with class

// create div element by javascript with class

var div = document.createElement('div');
div.className = "div1";
Posted by: Guest on June-15-2020
12

js create element

var newDiv = document.createElement("div");
document.body.appendChild(newDiv);
Posted by: Guest on April-04-2020

Code answers related to "document.createElement(nodename) a class"

Code answers related to "Javascript"

Browse Popular Code Answers by Language