两个元素数据如何定位一个元素?

时间:2017-01-13 10:31:21

标签: html css twitter-bootstrap

我有一个html页面services.html

 <div id="serviceData">
       <div class="container table-options-section ">
        <div class="row">
            <div class="col-sm-12">
                <div class="row">
                    <select class="selectpicker col-sm-2">
                        <option>1</option>
                        <option>2</option>
                    </select>
             <input class="col-sm-2" type="text" placeholder="Enter Value">              
                <select id="productSelector" class="selectpicker col-sm-2">
                        <option>3</option>
                        <option>4</option>
                    </select>
                    <button class="btn btn-success">Go</button>
            </div>
        </div>
    </div>

    <table class="table" cellpadding="0" cellspacing="0" border="1">
        <thead>
        <tr>
            <th rowspan="2"></th>
            <th rowspan="2"></th>
            <th rowspan="2"></th> 
            <th class="group-header net"></th>
            <th colspan="3" class="group-header buy"></th>
            <th colspan="3" class="group-header sell"></th>          
        </tr>
        </thead>
        <tbody>
        <tr ng-repeat="row in data track by $index" class="noFocus">
            <td>{{}}</td>
            <td>{{}}</td>
            <td>{{}}</td>
            <td>{{}}</td>
            <td>{{}}</td>
            <td>{{}}</td>
        </tr>
        </tbody>
    </table>
</div>

我想将它与两件事联系起来。 一个来自我的菜单,名称为Service。当我点击它时,我想打开HTML页面(service.html)。

<li data-toggle="tab" data-target="#serviceData"><a>Service</a></li>

其他来自我的导航标签同名服务。当我点击它同样的html页面打开。

<li><a data-toggle="tab" href="#serviceData">Service</a></li>

相同的id(serviceData)无法做到这一点。 那怎么办呢?欢迎任何建议。 感谢。

1 个答案:

答案 0 :(得分:0)

从以下位置更改菜单li代码:

<li data-toggle="tab" data-target="#serviceData"><a>Service</a></li>

以下内容:

<li><a data-toggle="tab" href="#serviceData">Service</a></li>