<table class="table table-bordered table-striped">
<thead>
<tr>
<th>号码</th>
<th>姓名</th>
<th>位置</th>
<th>身高</th>
<th>体重</th>
<th>介绍</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
<p><em>信息摘自互联网内容 若有冒犯请原谅 请留言反馈 立即删除</em></p>
</div>
<script>
$('#myTabs a').click(function(e) {
e.preventDefault()
$(this).tab('show')
})
$('#searchText').change(function() {
console.log("dd");
var searchText = $(this).val();
var searchSelect = $('#searchSelect').val();
var $searchTr = "";
if(searchText != "") {
$('#search tbody').html("");
//筛选搜索
if(searchSelect == "name") {
$searchTr = $('#myTabContent').find('td:nth-child(2):contains(' + searchText + ')').parent();
} else if(searchSelect == "position") {
$searchTr = $('#myTabContent').find('td:nth-child(3):contains(' + searchText + ')').parent();
} else if(searchSelect == "about") {
$searchTr = $('#myTabContent').find('td:nth-child(6):contains(' + searchText + ')').parent();
} else {
$searchTr = $('#myTabContent').find('td:contains(' + searchText + ')').parent();
}
$searchTr.each(function(i, e) {
$('#search tbody').append($(e).clone(true));
});
//如果没有搜索结果 显示一个报错div
if($searchTr.length <= 0) {
$('#search tbody').html('<td colspan = "7"><div class="alert alert-warning" role="alert">没有内容</div></td>')
}
$('#search-tab').tab('show');
}
}).keyup(function() {
$(this).change();
})
$('#searchBth').click(function() {
$('#searchText').change();
})
</script>
</body>
</html>










