title: Can't execute javascript on dynamically created html button
body: <p>So im quite new to javascript/jquery, so i need some help.
  Here's the problem.
  I have a page, where a button triggers a jquery animation to reveal a log in form.(It just replaces the previous html that was in it's place)
  On the login form i have it dynamically create a button to hide the login form, and reveal the original html. But that button cannot be called by the .click method, or even the OnClick attribute does not work! Any Advice?</p>
  
  <pre><code>$(document).ready(function() {
  $("#login_button").click(function() {
  $("#menu").animate({height: "toggle"}, 500, function() {
  $("#menu").empty();
  $("#menu").append('&lt;button id="back_button"&gt;&lt;/button&gt;');
  $("#menu").animate({height: "toggle"}, {duration: 500, queue: false});
  });
  });
  });
  </code></pre>
  
  <p>And Then the code that listens for the "back_button" click:</p>
  
  <pre><code>$(document).ready(function() {
  $("#back_button").click(function() {
  $("#menu").animate({height: "toggle"}, 500, function() {
  $("#menu").append(//Regular HTML);
  $("#menu").animate({height: "toggle"}, {duration: 500, queue: false});
  });
  });
  });
  </code></pre>
  
  <p>Can javascript not be executed on a element generated my another javascript?
  Any thoughts would be great! Thanks in advance!</p>