Table of Contents

How to keep the current tab active on page reload in Jquery UI

You can easily active the current tab after reloading or refreshing the page. See below jQuery code example. You need to replace the tab ID (#efsmsi_tab). Use your own ID here

$(function() {

        $("#efsmsi_tab").tabs({
        show: function(event, ui) {}
        });

	$("#efsmsi_tab").tabs({
		active: localStorage.getItem("currentIdx"),
		activate: function(event, ui) {
		localStorage.setItem("currentIdx", $(this).tabs('option', 'active'));
	  }
	});
});
Share on facebook
Facebook
Share on twitter
Twitter
Share on linkedin
LinkedIn

Leave a Comment

Your email address will not be published.

Related Posts