Is it possible to remove class="dataTable"
from datatable and apply our own class. If so, then how to do it ?
I tried Jquery something like this.
$('#sourceDetails').removeClass('dataTable');
But no effect.
Is it possible to remove class="dataTable"
from datatable and apply our own class. If so, then how to do it ?
I tried Jquery something like this.
$('#sourceDetails').removeClass('dataTable');
But no effect.
Share Improve this question edited May 6, 2014 at 7:31 Raviranjan Mishra 8572 gold badges11 silver badges26 bronze badges asked Jan 17, 2014 at 8:09 af_khanaf_khan 1,0984 gold badges26 silver badges52 bronze badges 4- Can you share the html?? – Milind Anantwar Commented Jan 17, 2014 at 8:11
- <table cellspacing="0" cellpadding="0" border="0" id="someid" class="display dataTable" aria-describedby="someid_info"> html is generated dynamically. But i am posting just the table tag for your reference – af_khan Commented Jan 17, 2014 at 8:15
- And when you want to do removing of class and adding anotehr?? – Milind Anantwar Commented Jan 17, 2014 at 8:15
- I just removed the class from my dataTable using the JQuery you tried in the question. Worked for me O_O Why didn't it work for you? – AbdurRehman Khan Commented Feb 18, 2020 at 10:44
4 Answers
Reset to default 2Try this
$('#sourceDetails').addClass("NewClassName").removeClass('dataTable');
$('table').removeClass('dataTable');
Try:
$('#someid').addClass('newclass').removeClass('dataTable');
Try this one:
$(function () {
setTimeout(function () {
$('#sourceDetails').removeClass('dataTable');
}, 100);
});
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744795908a4594200.html
评论列表(0条)