Writing javascript functions with dynamically created data
<p>I'm looking for a way to have a javascript/jquery function that references dynamically created html. </p>

<p>Essentially I have a form that is created dynamically through <code>$('#list').append('an html form')</code>.  And then a function that looks something like:</p>

<pre><code>function add_repo(id){
    $.ajax({
        url:'/add_project/',
        datatype:'json',
        data:{'name': $('#'+id).value()},
        success:function(data){
            alert(data);
        },
    })
}
</code></pre>

<p>where id is a dynamically created identifier for each form created by the jquery <code>append</code> function.</p>

<p>But <code>add_repo()</code> causes an error in the javascript as the jquery id identifiers don't exist initially.  How should situations like this be handled?</p>
