I am using Data table with Button. I want to show Success button rather default. I tried this Code
buttons: [
{
extend: "excel",
className: "btn-sm btn-success",
titleAttr: 'Export in Excel',
text: 'Excel'
}]
This code is working but this is adding btn-success class, But I want to remove the btn-default class first and then add the success class.
Current Classes: "btn btn-default buttons-excel buttons-html5 btn-sm btn-success"
What I want : "btn buttons-excel buttons-html5 btn-sm btn-success"
$('#your_button_id').removeClass('btn-default');buttons.dom.buttonprop, which will give you total control over the tag and class-name creation. No need to do any JS hacks.