Reputation: 2101
I would like to apply CSS to a checkbox in the jQuery Datatables plugin. Now this CSS value would change under certain conditions , which is if true then I want to display the checkbox is red color else white.
I tried using the sClass attribute , but it gets applied to all the boxes. How can I apply them to the checkboxes depending upon the condition individually.
Upvotes: 2
Views: 1809
Reputation: 771
You can create a css style for custumized checkbox
.lala{color:red;}
now you can add this class to your desired CB with jQuery addClass() like:
$(this).addClass("lala")
Upvotes: 1
Reputation: 25165
Have the boxes carry classes names that refer to your conditions.
<checkbox class="condition1" ..... </...>
And then use the classnames condition_etc
to style the boxes accordingly.
Upvotes: 1