I am using jQuery and datatables. I want to add a class to the TR element of a particular row. I know how to find the row. The console.dir(row); shows the r
console.dir(row);
r
If you want to add class when using row add function in Datatables, you could get the TR-DOM from node() method:
node()
var datatable = $('#resultTable').DataTable(); var trDOM = datatable.row.add( [ "Col-1", "Col-2" ] ).draw().node(); $( trDOM ).addClass('myClass');