<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<body>
<span class="fake_h">Too</span>
</body>
<script>
$('.fake_h').click(function() {
$(this).addClass('active_h').removeClass('fake_h');
})
$('.active_h').click(function() {
alert()
})
</script>
When I click on span it removes the class fake_h
and add active_h
. But after that when I click span(class='active_h')
It doesn't work. Don't trigger alert or anything. Can anyone explain why it doesn't work.