专注于崩溃Div

时间:2018-07-02 07:28:54

标签: jquery html

如何使用jquery集中引导崩溃的div。这是我的脚本:

<div class="tab-pane fade in active" id="home1">
  <div id="treeMapCategory">
    <h2 class="m-b-xxs">Defect Categories<span class="btn btn-primary btn-xs pull-right" id="defectCategories" data-toggle="collapse" data-target="#insightDefectCategories"><i class="fas fa-comments"></i> Add Insights</span></h2>
  </div>
</div><br/>
<div class="collapse" id="insightDefectCategories" tabindex="1">
  <div class="ibox-content box">
    <div class="insightsTitle"><br/>
      <h3> <i class="fas fa-comments"></i> Insights for Defect Categories</h3>
    </div>
  </div>
</div>

1 个答案:

答案 0 :(得分:0)

这是您想要的吗?

$("#insightDefectCategories").first().focus()
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.0.1/jquery.min.js"></script>
<div class="tab-pane fade in active" id="home1">
  <div id="treeMapCategory">
    <h2 class="m-b-xxs">Defect Categories<span class="btn btn-primary btn-xs pull-right" id="defectCategories" data-toggle="collapse" data-target="#insightDefectCategories"><i class="fas fa-comments"></i> Add Insights</span></h2>
  </div>
</div><br/>
<div class="collapse" id="insightDefectCategories" tabindex="1">
  <div class="ibox-content box">
    <div class="insightsTitle"><br/>
      <h3> <i class="fas fa-comments"></i> Insights for Defect Categories</h3>
    </div>
  </div>
</div>