JQuery+javascript遍历tr td

function InitTable(tableID, trName) {
$(tableID + " tr").each(function (index, element) {
if (index == 0 || index == $(tableID + " tr").length - 1) {
return true;
}
var s = element.cells[0].innerHTML;
if ($.trim(s) != '') {
if (s.indexOf(trName) == -1) {
element.style.display = "none";
}
}
});
}

posted @ 2014-05-30 14:30  天藐水瓶  阅读(201)  评论(0编辑  收藏  举报