var arr = [], bgColor = "red";$("div").each(function(){ if($(this).css("background-color")==bgColor) arr.push(this);});