title: Update DOM after insert in jQuery
body: <p>Let's say I use jQuery to load new content into a specific DIV element. If I now want to catch events from inside that DIV element, I assume the DOM has to be updated somehow? What is the best way to deal with this?</p>
  
  <p>Edit: Here is an example of what I mean:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;script type="text/javascript" src="jquery-1.3.2.min.js"&gt;&lt;/script&gt;
      &lt;script&gt;
        $(document).ready(function(){
          $(".edit").click(function(){
            $(this).parent().load("edit");
          });
          $(".view").click(function(){
            $(this).parent().load("view");
          });
        });
      &lt;/script&gt;
    &lt;/head&gt;
    &lt;body&gt;
      &lt;div class='someid'&gt;
        &lt;input type='submit' class='edit' value='Edit'&gt;
      &lt;/div&gt;
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>where a file <code>edit</code> at the same level contains</p>
  
  <pre><code>&lt;input type='submit' class='view' value='View'&gt;
  </code></pre>
  
  <p>and a file 'view' contains</p>
  
  <pre><code>&lt;input type='submit' class='edit' value='Edit'&gt;
  </code></pre>
  
  <p>If you try this out you will see that when you first press Edit, the button changes to View, but then it doesn't change anymore. Why is this?</p>