Skip to content Skip to sidebar Skip to footer

Jquery Tr Add Class After First 5 Rows

I have n-tables on a page. I need to go through every table on the page and within each table i need to add a class to the rows but NOT the first 5 rows. My current js: $('.select

Solution 1:

$("table").each(function() {
  $("tr:gt(4)", this).addClass("hidden");
});

Note: the :gt(n) pseudo-class is zero-based so the first five rows are o to 4.


Post a Comment for "Jquery Tr Add Class After First 5 Rows"