title: Jquery loading different content, and manipulate the loaded content with the still running js
body: <p>Well I have 3 files. 1 is php.index 2 is javascript and 3 is php.loadinternet</p>
  
  <p>php.index has a small form</p>
  
  <pre><code>&lt;div id="login-button" class = "knopf"&gt;&lt;a href="?view=logs"&gt;Log in&lt;/a&gt;&lt;/div&gt;
  </code></pre>
  
  <p>which is being manipulated with</p>
  
  <pre><code>$("#login-button").click(function(e){
          e.preventDefault();
          var input = $("#connectwindow, value").val();
  
      $.ajax({
          type: "GET",
          url: "ajax/loadinternet.php",
          data: {"targetip": input},
          success: function(data){
              //history.pushState({"internet.php?view=internetlog");
              $('#logoutput').html(data);
  
  
          },
          error: function(){
              alert ("error loading");
          }
  
      });
  </code></pre>
  
  <p>after the passing of the data to loadinternet it echoes back this form:</p>
  
  <pre><code>echo    '&lt;div id="loginbox" align="right" class="boxgrid"&gt;
                      &lt;form action="" method="post"&gt;Username: 
                      &lt;input id="userlogin" type="text" class="textfieldcss" 
                      style="width: 60%;" name="username" value="'.$username.'"&gt;&lt;br&gt;
                      Password: &amp;nbsp;&lt;input id="userpassword"type="password" 
                      class="textfieldcss" style="width: 60%;" name="password" value="'.$username.'"&gt;
                      &lt;input id="logintoip" type="submit" class="textfieldcss" style="text-align: right;" 
                      value="Log in"&gt;
                      &lt;/form&gt;
                      &lt;/div&gt;';
  </code></pre>
  
  <p>and the last form should be manipulated with this form: However It's not working and i've been at it for an hour now trying to wrap my head around it.. tried both with the .click() and .submit() prevention, both is not working, nor is a simple alert in that click function below</p>
  
  <pre><code>$("#logintoip").click(function(e){
          e.preventDefault();
          var input = $("#userlogin, value").val();
          alert("stop");
  
          $.ajax(
          {
              type: "GET",
              url: "ajax/connect.php",
              data: {"targetip": input},
              success: function(index){
              $('#logoutput').html(index);
              },
              error: function(){alert("something went wrong here");}
              }       
          );
  
      });
  </code></pre>