dany12 13 Light Poster

I want to change the radio button color when i slect them and then change them back to default when I deselect them

I have made some code but this is not working as it should be

$(document).ready(function(){

    $(':radio').click(function(){

        if($(this).not(:checked)){

        ($this).closest('td').css('background','none')

        }

        else{

        ($this :checked).closest('td').css('background','red')


        }

    )}



});
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.