如何在點擊事件後進入特定標籤頁,我試過$("#tabs").tabs()
,因爲每次刷新時都會回到原來的狀態,但仍然無法正常工作,那麼正確的做法是什麼?如何在使用jquery的單擊事件之後轉到特定選項卡?
這裏是我的jQuery代碼:
$(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();
});
});
這裏是我的HTML代碼:
<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>
你試過$( '#標籤')點擊()? –