I'm trying to cause all elements with the same class name ("Cappy") to change color when this function is invoked, but the only way I know how to invoke all of them is by writing out a line with the variable (myPara) and an index number for each one, and as there are many of them this seems clumsy. Is there a simpler way to do this?
function mouseoverCaroline(){
var myPara = document.getElementsByClassName("Cappy");
myPara[0].style.backgroundColor = "red";
myPara[1].style.backgroundColor = "red";
myPara[0].style.color = "black";
myPara[1].style.color = "black";
myPara[0].style.borderColor = "#94a0b4";
myPara[1].style.borderColor = "#94a0b4";
}