title: DOM changed does not update click event
body: <p>I have a problem, it turns out that I have a system to approve and disapprove posts, and when I click on disapprove, I change the class so that the click event can react to it, but it seems that once the DOM has been changed at runtime, I can't get rid of the old event click and join the new one (when you change classes, there is a click event). I have tried "unbind" and "bind" but like a snowball, I don't know...</p>
  
  <pre><code>&lt;a href="javascript:void(0)" id="{{ $temas-&gt;id }}" class="aprobartema text-green-500 hover:text-green-600 hover:underline mr-3"&gt;Aprobar&lt;/a&gt;
  
  &lt;a href="javascript:void(0)"  id="{{ $temas-&gt;id }}"  class="desaprobartema text-yellow-500 hover:text-yellow-600 hover:underline mr-3"&gt;Desaprobar&lt;/a&gt;
  
  $('.aprobartema').click(function(){
     var id = $(this).attr('id');
     var url = '{{ route("tema.aprobar") }}';
      $.ajax({
      type: 'POST',
      url: url,
      data: 
      {
      "id": id,
       "_token": "{{ csrf_token() }}",
      },
      success: function(response) {
          let i=response.id;
          let nupositivo= parseInt($('#p-'+i).text(), 10);
          //alert(response.id);
         // alert('Tema aprobado');
          $('#'+i).html("Desaprobar");
          $('#'+i).removeClass();
          $('#'+i).addClass('desaprobartema text-yellow-500 hover:text-yellow-600 hover:underline mr-3');
          $('#p-'+i).html(nupositivo+10);
  
  
      }
  
          });
  });
       //desaprobar tema
   $('.desaprobartema').click(function(){
     var id = $(this).attr('id');
     var url = '{{ route("tema.desaprobar") }}';
      $.ajax({
      type: 'POST',
      url: url,
      data: 
      {
      "id": id,
       "_token": "{{ csrf_token() }}",
      },
      success: function(response) {
          let i=response.id;
          let nupositivo= parseInt($('#p-'+i).text(), 10);
          //alert(response.id);
         // alert('Tema aprobado');
          $('#'+i).html("Aprobar");
           $('#'+i).removeClass();
          $('#'+i).addClass('aprobartema text-yellow-500 hover:text-yellow-600 hover:underline mr-3');
           $('#p-'+i).html(nupositivo-10);
  
      }
  
          });
  });
  </code></pre>