I am using GreaseMonkey to recolor certain elements of a specific website. However, when using the loops below, only the first loop makes any changes. Changing the order that the loops are in will allow only the first loop to have effect.
var i;
var evenRows = document.getElementsByClassName("even");
for (i=0;i<=evenRows.length;i++) { evenRows[i].style.backgroundColor = '#555'; }
var oddRows = document.getElementsByClassName("odd");
for (i=0;i<=oddRows.length;i++) { oddRows[i].style.backgroundColor = '#333'; }
var theLinks = document.getElementsByTagName("a");
for (i=0;i<=theLinks.length;i++) { theLinks[i].style.color = '#aaa'; }