title: After chang the content to button the button dose not work Jquery
body: <p>I have  problem when I change the div td tag content to a tag the a tag dose not working after I clicked it same with input
  this is the td tag</p>
  <pre><code>&lt;td class='column2' id='e&quot; . $row[&quot;id&quot;] . &quot;'&gt;
          &lt;a class='link' state='&quot; . $row[&quot;id&quot;] . &quot;,&quot;.$_SESSION[&quot;id&quot;].&quot;'&gt; 
             &lt;span data-content='Enroll'&gt; 
                 Enroll
             &lt;/span&gt;
          &lt;/a&gt;
      &lt;/td&gt;
  &lt;td class='column3' id='d&quot; . $row[&quot;id&quot;] . &quot;'&gt;
  &lt;/td&gt;
  </code></pre>
  <p>this is my JQuery</p>
  <pre><code>$(document).ready(function(){
              $(&quot;input&quot;).click(function(){
                  alert(&quot;in&quot;);
                  var StateName = $(this).attr(&quot;state&quot;);
                  var classID = parseInt(StateName.substring(0, StateName.indexOf(&quot;,&quot;)));
                  var ID = parseInt(StateName.substring(StateName.indexOf(&quot;,&quot;)+1));
                  var e = &quot;#e&quot;+classID;
                  var d = &quot;#d&quot;+classID;
                  var Enrollbutton = &quot;&lt;a class='link' state='&quot; + classID + &quot;,&quot; + ID + &quot;'&gt; &lt;span data-content='Enroll'&gt; Enroll&lt;/span&gt;&lt;/a&gt;&quot;;
                  $.post(&quot;Drop.php&quot;,
                         { Drop: classID, 
                           ID: ID
                         },
                         function(data , state){
                             if(state){
                                  alert(&quot;The class droped successfuly&quot;);
                                  $(d).html(&quot;&quot;);
                                  $(e).html(&quot;&quot;);
                                  $(e).append(Enrollbutton);
                              }else{
                                  alert(&quot;The class does not Droped successfuly&quot;);
                              }
                          });
              });
              $(&quot;a&quot;).click(function() {
                  var StateName = $(this).attr(&quot;state&quot;);
                  var classID = parseInt(StateName.substring(0, StateName.indexOf(&quot;,&quot;)));
                  var ID = parseInt(StateName.substring(StateName.indexOf(&quot;,&quot;)+1));
                  var e = &quot;#e&quot;+classID;
                  var d = &quot;#d&quot;+classID;
                  var dropbutton = &quot;&lt;div class='outer'&gt;&lt;div class='inner'&gt;&lt;label&gt;&lt;input type='submit' value ='Drop' class='drop' state='&quot;+classID+&quot;,&quot;+ID+&quot;'&gt;&lt;/label&gt;&lt;/div&gt;&lt;/div&gt;&quot;;
                  $.post(&quot;Enroll.php&quot;,
                         { Enroll: classID, 
                           ID: ID
                         },
                         function(data , state){
                             if(state){
                                  alert(&quot;The class Enrolled successfuly&quot;);
                                  $(e).html(&quot;&quot;);
                                  $(e).append(&quot;Enrolled&quot;);
                                  $(d).append(dropbutton);
                              }else{
                                 alert(&quot;The class does not Enrolled successfuly&quot;); 
                              }
                          });
              });                
          });
  </code></pre>
  <p>I am a beginner in JQuery and search for this problem but found nothing so I wish you could help me thanks for all</p>