Twitter Bootstrap Tabs: Go to Specific Tab on Page Reload or Hyperlink

Use Bootstrap Tab and then add this JS code. That’s it!

// Javascript to enable link to tab
var url = document.location.toString();
if (url.match('#')) {
$('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show');
}

// Change hash for page-reload
 $('.nav-tabs a').on('shown.bs.tab', function (e) {
 window.location.hash = e.target.hash;
 window.scrollTo(0, 0);
 })
Available for work