How to get search input or whatever element in the table?
How to get search input or whatever element in the table?
Camo
Posts: 33Questions: 6Answers: 0
I need to change some definitions on elements in the table. But I am not able to get it.
I find this code somewhere
"initComplete": function () {
var api = this.api();
api.$('.dataTables_filter input').addClass('form-control');
console.log(api.$('.dataTables_filter')); }
Console shows empty result for the selector. Thanks.
This discussion has been closed.
Answers
You are using
[jQuery addClass()](https://api.jquery.com/addclass/) chained from an instance of the Datatables API which won't work. Try removing the
api.` for just this:Kevin
Thanks you. I really dont know where I found it.