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-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.

       alert("Clicked on Second Time");

Can anybody help me to get rid out of this ?

Source: wordpress

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.