title: How to change the css of a dynamically added element?
body: <p>I am adding several divs with class "data_record" dynamically to the DOM.</p>
  
  <p>I want each one to turn a colour when clicked and for the others to turn back to a white background.</p>
  
  <p>Here is my code to do this after having successfully added the data_record elements...</p>
  
  <pre><code>$(document).on('click', ".data_record", function(event) {
      //turn all others white (this DOES NOT work!)
      $('.data_record').css('background','#ffffff');
  
      //turn the clicked element a different colour (this DOES work!)
      $(this).css('background', '#EDC580');
  });
  </code></pre>
  
  <p>So how to I target dynamically added elements by their class?</p>
  
  <p>Thanks.</p>