$(function(){ $('.news-tab').on('click', function(){ $('.news-tab').removeClass('news-tab-active'); $(this).addClass('news-tab-active'); $('.news-list').hide(); $('.block-' + $(this).data('tag')).show(); $('.news-more').attr("href", ($(this).data('tag') == 'news' ? '/dynamic/company-news' : '/industry-information/industry-news')); }) })