Cara menjaga tab saat ini tetap aktif di halaman ulang halaman

$('button[data-bs-toggle="tab"]').on('show.bs.tab', function(e) {
	localStorage.setItem('activeTab', $(e.target).attr('data-bs-target'));
});
var activeTab = localStorage.getItem('activeTab');
if (activeTab) {
	$('#myTab button[data-bs-target="'+activeTab+'"]').tab('show');
}
Noob Learner