是否可以使用jquery在按钮单击时禁用同一页面上的所有选项卡?

时间:2013-01-15 11:10:32

标签: jquery

如何在jquery中使用按钮ID禁用按钮上的标签?      在以下PHP页面中,li标签中声明了四个选项卡,我使用bootstarp创建。

<form class="form span11">
    <div class="tabbable" id="tab">
        <div class="">
            <ul class="nav nav-tabs">
                <li class="active"><a href="#comments" data-toggle="tab">Comments</a></li>
                <li class=""><a href="#" data-toggle="tab">Activities</a></li>
                <li class=""><a href="#locations" data-toggle="tab">Locations</a></li>
                <li class=""><a href="#pohistory" data-toggle="tab">PO History</a></li>
            </ul>
        </div>
        <div class="tab-content">
            <div class="tab-pane active" id="comments">
                <?php include "views/projects/comments.php"; ?>
            </div>
            <div class="tab-pane " id="locations">
                <?php include "partners_locations.php"; ?>
            </div>
            <div class="tab-pane " id="pohistory">
                <?php include "pohistory.php"; ?>
            </div>
        </div>
    </div>
<button id="set" type="button">submit</button>
</form>

1 个答案:

答案 0 :(得分:0)

$("#set").click(function () {
    $( "#tab" ).tabs({ disabled: true });
});