Overwrite button class in a colvis button
Overwrite button class in a colvis button
I am using bootstrap5 datatables set up.
I have a button for column visibility. The button comes already styles with btn-secondary.
I have done this
buttons: [
{
extend:'colvis',
text:'Show/Hide',
className:'btn-primary'
}
],
I want the button to come in the btn-primary class which is the color for my application but it doesn't change. The btn-secondary prevails. The colour changes when i change the className to bg-primary but that isn't quite what I want. How can I either overwrite or remove the btn-secondary class so my btn-primary color canwork/show
Answers
See if this thread helps.
Kevin
Oh thanks Kthorngren, The problems look similar. I'm using vanilla Js and not jquery with my datatables. I guess I would need to figure out how to do the solution I saw in vanilla Js.
without jQuery is:
or if there is only one element (and you are certain there is a matching element):
Allan