Jquery选择所有行,而不仅仅是大于零的行

时间:2016-03-29 18:09:30

标签: jquery html

我有这段Jquery代码

$("#reconciliation-grid").find('tr:gt(0)').each(function (queueIndex, queueItem)

我想更改它以便找到 all tr,而不仅仅是大于第0行的tr。我可以更改它以找到(' tr')?

1 个答案:

答案 0 :(得分:1)

jQuery使用CSS选择器。

所以,您可以尝试:

$("#reconciliation-grid tr").each(function (i,e){

}

对于td,您可以这样做:

   $(function(){

        $('#reconciliation-grid tr td').each(function(i,e){

            $(e).css({border:'3px solid red'})// This will give a Red 3px Solid Border to all "td" elements

})

        })

这假设您的<table id = "reconciliation-grid">

相关问题