title: <a href> link wont work when loaded with javascript
body: <p>I have a very small page being managed by some javascript. When I load the page into the browswer the link after the form (id=login_linker) works fine. </p>
  
  <p>However, when I load it into a div the same link wont work. Does anyone have any ideas. </p>
  
  <p>Here is the body of the page that is being included. </p>
  
  <pre><code>&lt;body&gt;
    &lt;p&gt;Forgot your password?&lt;/&gt;
    &lt;form name="forgotpassform"  id="forgotpassform" onsubmit="return false;"&gt;
      &lt;label for="email"&gt;Email: &lt;/label&gt;
      &lt;input id="email" type="text" class="searchbox" onfocus="emptyElement('status')" maxlength="35"&gt;
   &lt;input type="button" style="margin-top: 15px; position:relative; left:50px;" id="forgotpassbtn" onclick="forgotpass()" value="Send me a new password"&gt;
       &lt;br&gt;
  
    &lt;/form&gt;
       &lt;span id="emailstatus"&gt; &lt;/span&gt;
       &lt;span id="status"&gt;&lt;/span&gt;
   &lt;a href="#" id="login_linker" alt="show login"&gt;Log In&lt;/a&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>The javascript:</p>
  
  <pre><code>function forgotpass(){
      var e = _("email").value;
      var status = _("status");
      var forgotpassform = _("forgotpassform");
      if(e != ""){
          _("forgotpassbtn").style.display = "none";
          status.innerHTML = 'please wait ...';
          var ajax = ajaxObj("POST", "forgotpass.php");
          ajax.onreadystatechange = function() {
              if(ajaxReturn(ajax) == true) {
                  if(ajax.responseText == "no_user"){
                      status.innerHTML = 'There was no matching email in the system.';                    
                      _("forgotpassbtn").style.display = "block";
                  }  else if(ajax.responseText =="email_not_sent"){
                      status.innerHTML = 'There was a problem sending your temporary password.';      
                  } else {
                  //status.innerHTML = ajax.responseText;
                  forgotpassform.innerHTML = "You have sent a temporary password to your email address. Please check your email.";    
                  }
              }
          }
          ajax.send("e="+e);
      } else {
          status.innerHTML = "Please enter your email address.";
      }
  }
  
  function emptyElement(x){
      _(x).innerHTML = "";
  }
  
      function loadlogin(){
      $('#loginwindow').toggle(400);
  
      $('#loginwindow').load("forgotpass.php");
      $('#loginwindow').toggle(400);
  }
  
  $(document).ready(function(){
      $(document).on('click', '#login_linker', function(){
      alert('ok');
          showlogin();
      });
      });
  
  function showlogin(){
  $('#loginwindow').load("login.php");
  $('#loginwindow').toggle(400);
          }
  </code></pre>
  
  <p>Here  is the script to load the forgot password page ie the HTML above </p>
  
  <pre><code>function forgotpass(){
      $('#loginwindow').toggle(400);
      $('#loginwindow').load("forgotpass.php");
      $('#loginwindow').toggle(400);
  }
  </code></pre>