lala
lala

Reputation: 151

Resetting visuals for checked rows in a table via button

After clicking on the reset button, my checkbox does not work anymore.

My main issue is regarding the .click(function())

$('.button').click(function(){


    $("input[type='checkbox']").attr("checked",false);
    $( "td" ).css( "background", "white");
    $( "td" ).css( "color", "#000000" );


});

https://jsfiddle.net/kxxex32n/12/

Upvotes: 0

Views: 21

Answers (1)

Sebastian Simon
Sebastian Simon

Reputation: 19525

You’re overriding the style attribute in such a way that the CSS rules are more specific than the style sheet.

Just replace

$( "td" ).css( "background", "white");
$( "td" ).css( "color", "#000000" );

by

$(".checked").removeClass("checked");

Upvotes: 2

Related Questions