0

I called Ajax on button click, and I got response with link. Now I want to do some action on that link but I cant, why?

here is the ajax call:

$( document ).ready(function() {
  jQuery(".rateReset").click(function(){
     var data_item = jQuery(this).attr("data-item");
     var data_target = jQuery(this).attr("data-target");
     var me = this;
     jQuery.ajax({
        type: "POST",
        url: "likevoting.php?data_item="+data_item+"&data_target="+data_target+"&interchange=yes",
        success: function(data){
           jQuery(me).closest("div.rateWrapper").html(data);
        }
   });
});

I got response like:

some text link lorem ipsume...

Now I want to add click event on 'link' text, how to do this.

Thanks

BenG
  • 13,680
  • 4
  • 41
  • 57
Manish Negi
  • 280
  • 2
  • 16

1 Answers1

0

replace

jQuery(".rateReset").click(function(){

to

jQuery(document).on("click", ".rateReset", function(){
diavolic
  • 599
  • 4
  • 5