In general, there are 6 blocks, when you click on a block, it should turn blue, here is my script
$(document).ready(function(){ $(".price__list__wrapper").each(function(){ $(this).click(function(){ if ($(this).hasClass('non-active')) { $(this).css('backgroundColor','#467EEE').removeClass('non-active'); }else{ $(this).css('backgroundColor','#fff').addClass('non-active'); } }); }) }); It works fine, but you need to make sure that when you click on another block, the color of the current selected is removed, and they are highlighted in turn, and when you click again, the color is removed. It is necessary to work like a radio to eat while 1 is active the rest.