I use the "tab-title" attribute to liven up the entire menu, but I can't cope with the cookie and how after refreshing the page, set the "active" status to a specific menu resulting from the saved cookie. The cookie is, it has a value taken from the "tab-title" attribute, but I don't know how to enable the "active" status for the "tab" class. Any hints?
html
    <div class="tabbed_area">
    <ul 
        <li><a href="#" tab-title="nodeinfo-tab1" class="tab active"><i class="fa fa-sitemap fa-lg" aria-hidden="true"></i>  TAB1</a></li>
        <li><a href="#" tab-title="nodeinfo-tab2" class="tab"><i class="fa fa-bar-chart-o fa-lg" aria-hidden="true"></i>  TAB2</a></li>
        <li><a href="#" tab-title="nodeinfo-tab3" class="tab"><i class="fa fa-bar-chart-o fa-lg" aria-hidden="true"></i>  TAB3</a></li>
        
    </ul>
<div id="nodeinfo-tab1" class="cont">
        <table cellpadding="5" cellspacing="0" width="100%" align="center">
                <tr class="dark-edit">
                    <td class="nodeinfo-section-title" width="40%" colspan="2"nowrap><b>Head</b></td>
                </tr>
                <tr>
                    <td  class="tleft-edit" width="50%">TD1</td>
                    <td  class="tright-edit" width="50%" nowrap>TD2</td>
                </tr>
</div>
<div id="nodeinfo-tab2" class="cont">
        <table cellpadding="5" cellspacing="0" width="100%" align="center">
                <tr class="dark-edit">
                    <td class="nodeinfo-section-title" width="40%" colspan="2"nowrap><b>Head</b></td>
                </tr>
                <tr>
                    <td  class="tleft-edit" width="50%">TD1</td>
                    <td  class="tright-edit" width="50%" nowrap>TD2</td>
                </tr>
</div>
<div id="nodeinfo-tab3" class="cont">
        <table cellpadding="5" cellspacing="0" width="100%" align="center">
                <tr class="dark-edit">
                    <td class="nodeinfo-section-title" width="40%" colspan="2"nowrap><b>Head</b></td>
                </tr>
                <tr>
                    <td  class="tleft-edit" width="50%">TD1</td>
                    <td  class="tright-edit" width="50%" nowrap>TD2</td>
                </tr>
</div>
</div>
jquery
    $(document).ready(function(){
      $("a.tab").click(function(){
 
 var activeTabId = $(this).attr("tab-title");
            
        $(".active").removeClass("active");
             
        $(this).addClass("active");
         
                   
        $(".cont").slideUp();
          
       
        $("#" + activeTabId).slideDown();
        
    
    
        
        setCookie("activeTab", activeTabId, 1);    
    
    });
    var selectedID = getCookie("activeTab");
    if (selectedID) {
    $('a.tab[tab-title=' + activeTabId + ']').addClass('active');
}
});
function setCookie(c_name, value, exdays) {
    var exdate = new Date();
    exdate.setDate(exdate.getDate() + exdays);
    var c_value = escape(value) + ((exdays == null) ? "" : "; expires=" + exdate.toUTCString());
    document.cookie = c_name + "=" + c_value;
}
function getCookie(c_name) {
    var i, x, y, ARRcookies = document.cookie.split(";");
    for (i = 0; i < ARRcookies.length; i++) {
        x = ARRcookies[i].substr(0, ARRcookies[i].indexOf("="));
        y = ARRcookies[i].substr(ARRcookies[i].indexOf("=") + 1);
        x = x.replace(/^\s+|\s+$/g, "");
        if (x == c_name) {
            return unescape(y);
        }
    }
}
I have issue with this line $('a.tab[tab-title=' + activeTabId + ']').addClass('active');
Any help will be appreciated
Thank you !
 
    