How can I go to a specific tab after a click event, I tried $("#tabs").tabs() since every time I refresh it go back to its original but still does not work, what is the right way of doing it?
Here’s my jquery code:
$(function() {
$("#tabs").tabs();
$("#btn").click(function() {
//what to put here?
//I tried this but do not work, since i notice every refresh it go back to its original tab
$("#tabs").tabs();
});
});
Here’s my HTML Code:
<div id="tabs">
<ul>
<li><a href="#login">Login</a></li>
<li><a href="#register">Register</a></li>
</ul>
<div id="login">
</div>
<div id="register">
</div>
You can use the
selectmethod of jquery ui tabs: