There is a script that, upon click, assigns the class .active to the selector and changes the text of its child element:
$('.ticket-show-more').on('click', function(){ $(this).toggleClass('active'); $(this).find('span').text('Свернуть'); }); And there is a script that theoretically should work by clicking on the same selector with the class .active , but for some reason it does not work and the text does not change back:
$('.ticket-show-more.active').on('click', function(){ $(this).find('span').text('Подробнее'); }); How to fix it?