var search = $('#key').val();
$('.layui-table-fixed tbody tr').each(function (i) {
//console.log($(this).children('td').eq(1));
var id = $(this).children('td').eq(1).children('div').html();
if (id.indexOf(search)>-1) {
$(this).show()
$('.layui-table-main tbody tr').eq(i).show()
} else {
$('.layui-table-main tbody tr').eq(i).hide()
$(this).hide();
}
});
通过获取元素,将符合条件的显示,其他内容隐藏