How to Set Active Tab in jQuery Ui

后端 未结 9 1475
灰色年华
灰色年华 2020-12-08 18:51

Can you please let me know how I can set the active tab in jquery ui with a button click out of the tabs?

I have a button like:



        
9条回答
  •  旧巷少年郎
    2020-12-08 19:12

    You can use this:

    $(document).ready(function() {
        $("#tabs").tabs();
        $('#action').click(function() {
            var selected = $("#tabs").tabs("option", "selected");
            $("#tabs").tabs("option", "selected", selected + 1);
        });
    });
    

    Also consider changing the input type as button instead of submit unless you want to submit the page.

提交回复
热议问题