How to keep the tab active when the user come page to page?

Sure thing. If you want to record that the welcome tab is open you could set a cookie for that with:


createCookie('homepageTabs', 'welcome');

When the page first loads you might want to see if there is any cookie information about the homepage tabs, so that you can then do stuff based on that info.


var activeTab = readCookie('homepageTabs');
if (activeTab) {
    // show the tab, which from earlier would be the welcome tab
}

Since you’re using jQuery though, were you aware that jQueryUI tabs uses the same technique already, to automatically remember which tab is currently open?

The “View source” link on that page shows you how that’s achieved using the tabs plugin that goes with jQueryUI.