Skip to content
Advertisement

I want to add and remove class when URL having nav tabs id

I have added Bootstrap’s nav-tabs to my project. I was able to add logic that adds current tab’s ID to URL.

Now I would like for my JS to activate tab on page load, based on ID provided by URL parameter/hash.

The problem I am getting now it just picking up the last if condition.

JavaScript
JavaScript

Advertisement

Answer

if you declare var url at first then why you using string “url:contains(”)” ??

try this :

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement