I want to check if a table element with say, id=\"datatable\" is datatables-initialized. Something like this:
if ($(\'#datatable\').dataTable().initialized) {
You can the fnIsDataTable function in jQuery datatable
var ex = document.getElementById('example'); if ( ! $.fn.DataTable.fnIsDataTable( ex ) ) { $(ex).dataTable(); }
You can find more information in api