Click function for dynamically added class jquery not working [duplicate]

This question already has an answer here:

I have added the class using addClass

$(".show-btn").click(function()
    {
       $(".show-all a span").addClass("intro");
   });

Till here its fine,class is added where it was supposed to be.

But what i want is the click method to work for the next click to the button.

$(".intro").click(function()
    {
       alert("Clicked on Second Time");
    });

Can anybody help me to get rid out of this ?


Source: wordpress

Leave a Reply