I am trying to set the background color of Calendar overlay using javascript. I can set them using a static css file, but I would like to do that via javascript, based on certain conditions.
var allOrangeJuiceQuery = document.querySelectorAll('.ms-acal-color5.ms-acal-apanel-color5');
for (var i=0, len=allOrangeJuiceQuery.length; i<len; i=i+1|0) {
allOrangeJuiceQuery[i].style.backgroundColor="red";
}
this code does not seem to work. If it is a css object, I can set it but not if it is a class. Any help is much appreciated.