I am new to jquery and bootstrap,so please consider my mistakes.I have created a bootstrap modal for login and registration. It contains two nav-tabs called as login and reg
HTML:
<a href="PageName.php#tabID">link to other page tab</a>
Javascript:
window.onload = function(){
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[href="#' + url.split('#')[1] + '"]').on('shown', function (e) {
window.location.hash = e.target.hash;
});
}
You may access through tab Id as well, But that id is unique for same page. Here is an example for same
$('#product_detail').tab('show');
In above example #product_details
is nav
tab
id