Joelio Joelio - 1 month ago 5
jQuery Question

how to get class from jquery datatable row object?

I have a jquery datatable row:

table = $('#reports').DataTable()
row = table.row(rowIndex)


How do I get the html class from it? (it is striped and I want to find out if it is odd or even.

I have tried:

row.hasClass('odd')

row.className

row.attr('class')


any ideas?

Answer

Use node with className:

row.node().className;
Comments