【发布时间】:2010-11-17 16:00:55
【问题描述】:
在 JQuery 中,使用以下代码很容易根据预定义的列 td 值隐藏表行。
function filterRows(word){
$('.application>tbody>tr')
.show()
.find('td:nth-child(2)').not(':contains("'+word+'")')
.parent()
.hide()
}
但是,我将如何在多列中显示与 td 值匹配的行。
类似下面的东西(不起作用)
function filterRows(word){
$('.application>tbody>tr')
.show()
.find('td:nth-child(2)').not(':contains("'+word+'")')
.find('td:nth-child(3)').not(':contains(30)')
.parent()
.hide()
}
基本上我希望能够只显示我的单词在“word”中传递的行在第二列 td 中,第三列包含“30”。
感谢您的提醒。
【问题讨论】:
标签: jquery