Keep js after reload the page

I understand, that you want “a.music” remain set active after you reload the page.

For that you can check whether the cookie is set or not if it is set you make active to the “a.music” else it will remain as same.

var tags = getCookie('tags');
jQuery('a.music').each(function(){
    var dTag = jQuery(this).attr("data-tag");
    if(dTag == tags)
    {
        jQuery(this).find('h4').addClass("a-active");
        jQuery(this).find('h4').css("color","red");
    }
});