title: Adding Click Function to Dynamically Generated div jquery
body: <p>I am fairly new to JQuery and I am having issues with binding functions to a dynamically generated div. </p>
  
  <p>Essentially the user clicks a button which adds a couple divs to a container and also changes the background color of that container. I want them to have the option to remove what they added by clicking on one of the divs. </p>
  
  <p>I have this function that I thought should do that:</p>
  
  <pre><code>$('.course-delete').click(function() {
      var course = $(this).parent();
      alert("hello");
      $(course).css('background', "#fff");
      $(course).empty();  
  });
  </code></pre>
  
  <p>But for whatever reason nothing happens when I click the div. If anyone knows what is going on I would appreciate it.</p>