It seems that the Visual Composer Tab is not allowing the Custom JavaScript to perform its function when page is reloaded/refresh.
My goal is to select same tab as the page reloads or refresh due a form submits a data on one tab.
I got this code:
var $j = jQuery.noConflict();
$j('.wpb_tabs_nav li a').click(function(){
var hrefs = $j(".wpb_tabs_nav .active-tab").attr("href");
localStorage.setItem("link", hrefs);
var links = localStorage.getItem("link");
console.log(".wpb_tabs_nav li a[href='"+ links +"']");
});
$j( document ).ready(function() {
var links = localStorage.getItem("link");
console.log(".wpb_tabs_nav li a[href='"+ links +"']");
$j(".wpb_tabs_nav li a[href*='"+ links +"']").addClass('active-tab');
$j(".wpb_tabs_nav li a[href*='"+ links +"']").click();
});
if this code is on the page the first load I can see it selects right but I automatically jump into the first tab again. It is weird but can you help me with this?