title: Change style for array of DIVS
body: <p>I have 100 DIVS in an array called '<strong>lights</strong>', appended to the page with a unique ID. Some of those DIVS are also in another array called '<strong>frozen</strong>'.</p>
  
  <p>How can I change the background color of the DIVS in '<strong>lights</strong>' but not the divs in the '<strong>frozen</strong>' array?</p>
  
  <p>For example, to change all of the divs I would use:</p>
  
  <pre><code>for(var l=0;l&lt;LIGHTS_NUMOF;l++){
  
  $("#light"+l).css("background-color", "#ff0000");
  
  }
  </code></pre>
  
  <p>Generating the array:</p>
  
  <pre><code>var LIGHTS_NUMOF = 100;
  var lights = [];
  
  for(var l=0;l&lt;LIGHTS_NUMOF;l++){
      var newLight = $("&lt;div class=\"light\" id=\"light"+l+"\"&gt;&lt;/div&gt;");
      $(".lights").append(newLight);
      lights.push(newLight);
  }
  </code></pre>
  
  <p>However, this obviously changes ALL of the divs.</p>
  
  <p>How do I avoid changing the DIVS which are in the '<strong>frozen</strong>' array?</p>
  
  <p>Ideally I would like to express lights.backgroundcolor = 'red' where DIV isn't 'frozen'.</p>
  
  <p>Adding DIV to 'frozen':</p>
  
  <pre><code>$( ".light" ).click(function() {
  frozen.push(this);
  });
  </code></pre>