I have this HTML:
<div class="bold knowmore login" id="j-6">
<span>...</span>
</div>
and this jQuery:
$(function(){
  $(".login").on("click", function(){ 
     console.log('login clicked!');
     $(".bold.knowmore").removeClass("login").addClass("displayAdvert");
  });
  $(".displayAdvert").on("click",function(){
    console.log("display was clicked!");
  }); 
});
But the output is always:
login clicked!
But, for some reason, the HTML is updated but the event always calls the click login. Someone has an idea how I can resolve it?
 
     
     
     
    