I have a HTML page which has horizontal tabs defined as follows
<ul class="tabs clear has-borderbottom">
<li class="js-tab selected" data-tab="tab1"><a href="#">TAB 1</a></li>
<li class="js-tab" data-tab="tab2"><a href="#">TAB 2</a></li>
<li class="js-tab" data-tab="tab3"><a href="#">TAB 3</a></li>
</ul>
When I load the page it opens with TAB 1 opened which is ok for me in all cases. But there is one condition where I want to load TAB 2 as the opening tab instead of tab 1. How can I do this programatically in js?
I use window.location.href = "/details
to redirect to the above HTML page where I want to display TAB 2 opened be default.