Redirect to a particular tab <pre><code>&lt;ul class="tabs" style="background: "&gt; &lt;li&gt;&lt;a href="javascript:tabSwitch('tab_1', 'content_1');" id="tab_1" class="active"&gt;Payment Gateway Basics&lt;/a&gt;&lt;/li&gt; &lt;li&gt;&lt;a href="javascript:tabSwitch('tab_4', 'content_4');" id="tab_4" &gt;Contact Us&lt;/a&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>These are my tabs, once I submit a form in the "contact us" tab, it goes back to the first tab. Can anyone tell me how to stay in the same tab?<br> I'm using PHP server side switching, I'm using JavaScript.</p> <p>(I used <code>href</code> not <code>onclick</code> in the listing. Stack Overflow doesn't allow to use more <code>href</code> so I changed it into <code>onclick</code>, before this post was edited).</p>