.container-new{
background-color:forestgreen;
height:50px;
width:50px;
display:block;
float:left;
margin-left:30px;
margin-top:30px;
padding:10%;
visibility:visible;
color:red;
}
.projectcontainer{
background-color:lightsteelblue;
display:block;
height:500px;
width:600px;
margin-top:5%;
visibility:visible;
}
var maindiv = document.getElementById('container');
for (let x = 0; x < 9; x++) {
var newdiv = document.createElement('div');
newdiv.innerHTML = "addd";
newdiv.setAttribute('class', 'container-new');
maindiv.setAttribute('class', 'projectcontainer');
maindiv.appendChild(newdiv);
}
i tried this..am getting the newdiv's innerhtml and cssclass of maindiv .
But the cssclass of child div i.e newdiv isn't getting ( .container-new)..