How to change the checked property of radio buttons?

Sounds corny of course, but something do not fucking impossible to track the deletion of the checked property of radio buttons.

$("input[value='kn1']").change(function() {
 if ($(this).prop("checked")) {
 $('.block').css("display", "block"); // This code works
 } else {
 $('.block').css("display", "none"); // This code will never work
}
});
July 2nd 19 at 17:19
1 answer
July 2nd 19 at 17:21
Solution
Thank you all who tried to help.
If anyone need the solution (though in this case tracked the entire group of radio buttons):

$("input[name='radio-buttons-group']").change(function() {
 if ($("input[value='kn1']").prop("checked")) {
 $('.block').css("display", "block"); // This code works
 } else {
 $('.block').css("display", "none"); // And this too
}
});
So it does not remove the value. - Lelah.Friesen59 commented on July 2nd 19 at 17:24
So you had to when on another button to switch the value with the old left ? that's it ? I thought you have to press and doing a check on uncheck inmate. Build the questions correctly :) - Lelah.Friesen59 commented on July 2nd 19 at 17:27
"track deletion of the checked property of radio buttons." Completely. - Lelah.Friesen59 commented on July 2nd 19 at 17:30
: With all due respect, but once again, I read carefully the title and your comments, did not understand what suggestions you can understand that I needed to "check uncheck on inmate", especially that this is usually used checkbox's )) - Sherman commented on July 2nd 19 at 17:33
: "track" and "follow" are two different tasks. No need to run, this property itself is removed when clicking on another radio button, the problem was only in that method .change() this event is not tracked. So the question was, "how to TRACK". - Sherman commented on July 2nd 19 at 17:36

Find more questions by tags jQueryCSSJavaScript