title: Help with jQuery Delegate
body: <p>Im trying to use .delegate to assign click events to dynamically loaded content. As you scroll additional content is loaded via Ajax.</p>
  
  <p>Here is the jQuery I have written which works for the static content but not for the content that gets loaded dynamically:</p>
  
  <pre><code>$('#fav').delegate("#submit", "click", function() {
  
      var favid = $("input#favid").val();
      var favsave = 'favid=' + favid;
      $.ajax({
        type: "POST",
        url: "fav.php",
        data: favsave,
        success: function() {
          $('#fav').fadeOut(100);
        }
      });
      return false;
  
  });
  </code></pre>
  
  <p>Here is my HTML:</p>
  
  <p>
    
      Button</p>
    </p>
  
  <p>
      
        http://a2.twimg.com/profile_images/499579722/Lambda_twitterPic_normal.gif'alt='lambdasolutions' title='lambdasolutions' />
        http://twitter.com/lambdasolutions' alt='lambdasolutions' title='lambdasolutions'>lambdasolutions</p>
  
  <pre><code>  &lt;div class='atweet'&gt;Why Use Moodle? | 
      &lt;a target='_blank' href="http://bit.ly/aLld9q"&gt;http://bit.ly/aLld9q&lt;/a&gt; | &lt;a target="_blank" href="http://search.twitter.com/search?q=%23moodle"&gt;#moodle&lt;/a&gt; 
      &lt;a target="_blank" href="http://search.twitter.com/search?q=%23elearning"&gt;#elearning&lt;/a&gt; 
      &lt;a target="_blank" href="http://search.twitter.com/search?q=%23edtech"&gt;#edtech&lt;/a&gt; 
    &lt;/div&gt;
  
    &lt;div class='date'&gt;16-09-2010 22:44&lt;/div&gt;
  
      &lt;form id='fav' method='post' class='options' action=''&gt;
        &lt;input style='display: none;' type='text' name='fav' id='favid' value='24699868222' /&gt;
        &lt;input type='submit' value='Add to Favorites' name='submit' id='submit' /&gt;
      &lt;/form&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>Basically new content gets added to the start of this list, and to the end of this list archive content gets added as the user scrolls.</p>
  
  <p>Im using delegate on other parts of the page and it works but not this part.</p>
  
  <p>Any help appreciated!</p>