title: jQuery: Add ID to newly generated DOM element
body: <p>So I have a div with class <code>ngg-navigation</code>. I needed to add an ID to it using jQuery because I can't touch the HTML directly. Here's what I had:</p>
  
  <pre><code>    jQuery(function($){
          $('.ngg-navigation').attr('id', 'ngg-navigation-id');
      });
  </code></pre>
  
  <p>This works fine on the initial load, but there's other javascript that does AJAX and refreshes the div, resulting in the disappearance of the <code>ngg-navigation-id</code> ID. Is there a way to add the ID every time it appears?</p>