title: jQuery dynamic selection stops working after initial trigger
body: <p>I'm creating a page with several lightboxes. The button for the lightbox is this:</p>
  
  <pre><code>&lt;button class="lightbox" data-lb="result-slide1"&gt;See More Results&lt;/button&gt;
  </code></pre>
  
  <p>The lightbox is triggered like this:</p>
  
  <pre><code>var lightboxButtons = $('.lightbox');
  
  lightboxButtons.on('click', function(e) {
      e.preventDefault();
      var button = $(this);
      var lightboxData = button.attr("data-lb");
      overlay.fadeIn();
      lightboxDisplay(lightboxData);
  });
  </code></pre>
  
  <p>And the lightbox is displayed like this:</p>
  
  <pre><code>function lightboxDisplay(content) {
      var lightboxHTML = $('#' + content);
      lightboxContent.html(lightboxHTML);
      lightboxContainer.fadeIn();
  };
  </code></pre>
  
  <p>So basically the script gets the element with the <code>id</code> that matches the button's <code>data-lb</code> attribute, and puts that element's html into the lightbox.</p>
  
  <p>The problem is that this stops working if these steps happen:</p>
  
  <ol>
  <li>Lightbox button A is triggered</li>
  <li>Lightbox button B is triggered</li>
  <li>Lightbox button A is triggered again</li>
  </ol>
  
  <p>When this happens, the lightbox displays, but doesn't have any content in it. When I <code>console.log(lightboxHTML)</code> it shows an empty object if those steps are followed, so the problem has something to do with that variable somehow. Thanks for looking.</p>
  
  <p>EDIT: Here is the function that runs when a close button is clicked:</p>
  
  <pre><code>function lightboxReset() {
      overlay.fadeOut();
      lightboxContainer.fadeOut();
  };
  </code></pre>
  
  <p>EDIT2: Here is some HTML of what might go into the lightbox from the jQuery selection:</p>
  
  <pre><code>&lt;article class="slide-content results-lb-container" id="result-slide1"&gt;
      &lt;img src="img/profile-placeholder.png" alt=""&gt;
      &lt;p&gt;Lorem ipsum dolor sit amet, consectetur adipiscing elit. Praesent at eleifend orci. Aliquam ac bibendum erat. Sed dapibus placerat feugiat. Nam et risus a purus scelerisque dignissim at ac purus. Donec dapibus nulla et lectus fringilla elementum. Vivamus orci ipsum, tincidunt id nisl posuere, rutrum imperdiet nibh. Fusce vitae dignissim libero. Nulla vel sapien urna. Fusce et mauris et neque imperdiet suscipit. In pretium elit felis, in consequat nulla ornare et. Etiam finibus nibh lorem, vitae placerat magna commodo ut.&lt;/p&gt;
  &lt;/article&gt;
  </code></pre>