2

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.

2 Answers 2

1

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")
Sign up to request clarification or add additional context in comments.

Comments

1

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.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.