Twitter Bootstrap - Tabs - URL doesn't change

前端 未结 15 1602
长情又很酷
长情又很酷 2020-11-28 18:53

I\'m using Twitter Bootstrap and its \"tabs\".

I have the following code:

15条回答
  •  旧时难觅i
    2020-11-28 19:16

    I understood that OP said using JQuery but you can simply use vanilla JS to do that:

    document.querySelectorAll('ul.nav a.nav-link').forEach(link => {
        link.onclick = () => window.history.pushState(null, null, link.attributes.href.value);
    });
    

提交回复
热议问题