I want to check if a table element with say, id=\"datatable\" is datatables-initialized. Something like this:
if ($(\'#datatable\').dataTable().initialized) {
First, add a special class name when you're initializing datatables:
$('.datatable').not('.initialized').addClass('initialized').dataTable()
And now you can tell them apart by class name:
alert( $('#datatable').hasClass('initialized') )