Force sub navbar to open

i am using v1
i have 3 tabs in sub navar
i am trying to force open second tab if the url contain X
i have added the class " active " to the second tab using js but it still doesnt open it …

if ( window.location.href.indexOf(‘tab-reviews’) > -1){


i tried also to trigger a click
$( “#tab-reviews” ).click()

sorry i am new to js
thank you