title: jQuery: How to add event handler to dynamically added HTML elements?
body: <p>I have the following code:</p>
  
  <pre>
  $(document).ready(function({
      $(".click").click(function(){
          alert(' The Button Was Clicked !');
      });
  }));
  </pre>
  
  <p>This works fine.<br />But If I add an element with the same class to the web page,  as shown here:</p>
  
  <pre>
  $('#clicked').click(function(){
      $("#area").append("&lt;button class='click'>Click me&lt;/button>");
  });
  </pre>
  
  <p>Then the event handler I added before to the .click class won't work for this new element. <br />
  What's that best way to add event handlers to elements that were added dynamically ?</p>