Link to home
Start Free TrialLog in
Avatar of flynny
flynnyFlag for United Kingdom of Great Britain and Northern Ireland

asked on

Change CssClass JQuery ASP:Checkbox

Hi all.

I have an ASP:Checkbox which I want to change the color of the text on it.

Now $('#<%=TermsCheckbox.ClientID%>').addClass('myclass');

is adding the class but the checkbox renders the text in a label using the same ID?

Any ideas how i can change this please?
Avatar of J N
J N

$("input[type='checkbox']").change(function(){
    if($(this).is(":checked")){
        $(this).parent().addClass("COLOR");
    }else{
        $(this).parent().removeClass("COLOR");  
    }
});

CSS
.COLOR{

}
Avatar of flynny

ASKER

but i need to do it for a particular check box not all.
ASKER CERTIFIED SOLUTION
Avatar of J N
J N

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
thanks for the points

good luck on your adventures