Javascript - add css style to element with class
You need to loop through your results because getElementsByClassName()
returns a collection of elements:
for(var i = 0; i < productAttr.length; i++)
{
productAttr[i].style.top = "-90px";
}
You need to loop through your results because getElementsByClassName()
returns a collection of elements:
for(var i = 0; i < productAttr.length; i++)
{
productAttr[i].style.top = "-90px";
}