Inject a form with Ajax, get its input value
<p>Main page div is updated with an Ajax request. The updated html contains a form with input fields, a button, and another Ajax script to submit that form. While it is possible to initiate the second script by pressing the button in the injected form, the script does not seem to find form inputs by id. 
I read about the .on() method of JQuery, but it only seems to provide access to dynamically updated functions, not elements.
How do I get the input element by ID, after this element got injected into the code with an Ajax request?</p>

<p>Main page:</p>

<pre><code> &lt;div id="output"&gt;&lt;/div&gt;
 &lt;span id="call_account"&gt;Account&lt;/span&gt;


 $("#call_account").click(function(){
     $.get('/accounts/login/', {}, function(data){
               $('#output').html(data);
           });
 });
</code></pre>

<p>Injected into #output html:</p>

<pre><code>&lt;input id="id_username" name="username" type="text"&gt;
&lt;input id="id_password" name="password" type="password"&gt;
&lt;span id="account_submit"&gt;Submit&lt;/span&gt;


        $("#account_submit").on("click", function() {

            var id_username = $('#id_username').val();
            var id_password = $('#id_password').val();

            $.ajax({
                 type:"POST",
                 url:"/accounts/login/",
                 data: {
                        'username': id_username,
                        'password': id_password,
                        },
                 success: function(data){
                         $('#output').html(data);
                 }
            });

        });
    });
</code></pre>

<p>id_username and id_password are undefined when I try to submit the form.</p>

<p>edit:
Thanks to answers from the guys below I was able to get it to work. I also made a jsfiddle simulation of the problem in the process: <a href="https://jsfiddle.net/hn1Lrkzs/" rel="nofollow">https://jsfiddle.net/hn1Lrkzs/</a>
Hope it helps someone in the future, I had trouble finding a direct answer, and lacked understanding to get the thing from help files.</p>