JQuery - click(fn) not working for dynamically added button
<p>Previously, the code I was using was working. But today, when I re-used the code, it is not working at all.</p>

<p>Code/Case situation:
I pre-defined an html code which inserts a new form after an existing default form. I am trying to use jQuery to add a <code>click</code> function to one of the buttons in the new form.The jQuery code is </p>

<pre><code>$("button[value='ADDTSG']").click(function(){
    var NEW = "&lt;div class='w175 mR9 mB9 p9 rCor cWhi' id='fL'&gt;&lt;form action='pro/lab_handle.php' method='post'&gt;&lt;input type='hidden' value='0' name='LID'/&gt;&lt;div class='w65 B ttU mR9' id='fL'&gt;TPC&lt;/div&gt;&lt;input type='text' class='w65 Dg4' name='QTPC'/&gt;&lt;br/&gt;&lt;hr/&gt;&lt;button value='NEWTSG' name='BTN' type='submit'&gt;&lt;img src='img/add.png'/&gt;&lt;/button&gt;&lt;button id='fR' type='button' value='XTSG'&gt;&lt;img src='img/del.png'/&gt;&lt;/button&gt;&lt;/form&gt;&lt;/div&gt;";

    $(".FORCLONE").after(NEW);
    $("button[value='ADDTSG']").hide();
    $("button[value='SAVETSG']").hide();
});

// buttons below not alerting at all, no function after click on it
$("button[value='XTSG']").click(function(){
    alert("close tsg"); return false;
});
$("button[value='NEWTSG']").click(function(){
    alert("new tsg"); return false;
});
</code></pre>

<p>The html for the default form is </p>

<pre><code>&lt;div id='fL' class='FORCLONE'&gt;
&lt;div id='fL' class='w175 bgBlu1 mR9 mB9 p9 rCor cWhi'&gt;
    &lt;form method='post' action='pro/lab_handle.php'&gt;
        &lt;input type='hidden' name='LID' value='1'&gt;
        &lt;div id='fL' class='w65 B ttU mR9'&gt;TPC&lt;/div&gt;&lt;input type='text' name='MTPC' class='w65 Dg4' value='555'&gt;
        &lt;button type='submit' name='BTN' value='SAVETSG'&gt;&lt;img src='img/ok.png'&gt;&lt;/button&gt;
        &lt;button id='fR' type='button' value='ADDTSG'&gt;&lt;img src='img/add.png'&gt;&lt;/button&gt;
    &lt;/form&gt;
&lt;/div&gt;
&lt;/div&gt;
</code></pre>

<p>Can anyone tell me why this is not working? By the way, I am using FireFox with web-developer plug-in, and there is no javascript error shown even i click on the "XTSG" / "NEWTSG" buttons.</p>
