jQuery select JavaScript generated elements
<p>I am using JavaScript to generate some HTML tables on the fly. After filling out this dynamic table, I employ jQuery to 'grab' some of the inputs and do some small calculations for form validation. However, my jQuery selector does not work with the dynamic HTML form. Can anyone give me some suggestions? Thanks!</p>

<p>Here is the code:</p>

<pre><code>&lt;script&gt;
//generate HTML table
$('&lt;tr&gt;&lt;th&gt;&lt;label for="id_CAM_1"&gt;Input:&lt;/label&gt;&lt;/th&gt;&lt;td&gt;&lt;select name="CAM_1_'+i+'" id="id_1_'+i+'"&gt;&lt;option value="1"&gt;Option 1&lt;/option&gt;&lt;option value="2"&gt;Option 2&lt;/option&gt;&lt;/select&gt;&lt;/td&gt;&lt;/tr&gt;').appendTo('.table');

// jQuery selector, which does not work dynamically

$('select[name=CAM_1_'+i+']').change(function() {
            var ss1=$(this).val()
            alert(ss1)})
&lt;/script&gt;
</code></pre>
