I have code that needs to be repeated quite often and Im not sure how to do it. It would be nice if the value of "REV" could automatically associate itself with whatever Id that is the name number as REV.


heres a small portion of the code

if (REV == 01) {document.getElementById("a01").style.backgroundColor = "#00DD00";}
if (REV == 02) {document.getElementById("a02").style.backgroundColor = "#00DD00";}
if (REV == 03) {document.getElementById("a03").style.backgroundColor = "#00DD00";}
if (REV == 04) {document.getElementById("a04").style.backgroundColor = "#00DD00";}
if (REV == 05) {document.getElementById("a05").style.backgroundColor = "#00DD00";}

any help is appreicated.