There are such divas <html>
<div class="colDiv">Color 1</div> <div class="colDiv">Color 2</div> <div class="colDiv">Color 3</div> here is js
var colorArray = [ document.getElementsByClassName('colDiv'), document.getElementsByClassName('colDiv'), document.getElementsByClassName('colDiv') ]; so getting the items you need to change color 2 diva
how to do it?
Did this:
myDiv.style.color = "blue"; tried this:
for (i = 0 ; i < colorArray.length; i++) { colorArray[i].style.backgroundColor = "#AA0000"; } does not work.