0

I don't know how to do this, when i click on a div, a class is added to an other div, so my problem is how to add event listner to the new added class.

$('div.my_class').on('click', function (e) {
        e.preventDefault();
        $(this).next().addClass('added_class');
});

$('div.added_class').on('click', function (e) {
        e.preventDefault();
        // some stuff here 
        $(this).prev().removeClass('added_class');
});
ler
  • 1,466
  • 3
  • 20
  • 37

0 Answers0