title: How to access the DOM after a previous JQuery call
body: <p>I'm not too familiar with JQuery so please be patient.</p>
  
  <p>Essentially, I have two hyperlinks on a view that runs some JQuery script:</p>
  
  <pre><code>     &lt;a href='#' class="deleteCustomer"&gt;Delete&lt;/a&gt;&lt;/td&gt;
         .
         .
       &lt;a href="#" class="undoCustomer"&gt;Undo&lt;/a&gt;
  </code></pre>
  
  <p>So, each of these links access different parts of the same .js file. My "Delete" does some processing which does a soft delete in the database.  The DOM loads and this works fine. I'm using firebug and, when I insert a console.log in .js I can see the id of the Customer I want to delete and the rest is straight forward. </p>
  
  <pre><code>$(container).find('a.deleteCustomer:first').click(function(e) {
              console.log("CustomerId " + $(container).find('input[name=Customer_CustomerId]:first').val());
  </code></pre>
  
  <p>My "Undo", however, accesses the same .js on a different line and console.log in the 'undo' part of .js reveals that it's not being hit.</p>
  
  <pre><code>$(container).find('a.undoCustomer').click(function(e) {
      console.log("CustomerId " + $(container).find('input[name=Customer_CustomerId]:first').val());
  </code></pre>
  
  <p>So, it appears that the DOM is not ready (?).  If this is the case, how do I fix this?  Do I have to reload the DOM manually?  If so, how?</p>
  
  <p>P.S. When I click 'Undo' first nothing seems to happen i.e. I don't get any console.logs in FireBug.  However, if I refresh the browser, it runs as expected i.e. the undo jquery about executes.</p>