I'm building a form that changes the background color of certain elements based on choices made. Later on I have the form validate based on static numerical values, but want to create exceptions for any fields that have had their background color changed.
My thought is collecting these elements into an array based on background color would work. I'm not sure how to check for a background color though. Hopefully the code below shows my thought process. The condition in the if statement doesn't work, I don't know if there's something similar that might pull this off.
var group = document.getElementsByClassName = ('groupClass');
for(i=0;i < group.length;i++){
if(group[i].style.backgroundColor == "#000"){
//add group[i] to an array
}
}