There were many issues from extra parenthesis in a couple places to wrapping an int in a jquery object ($(score_yes)
for example) to binding on .yes:checked
(I believe you want .yes, .no
as both those would change the #result
). There was also a bit of simplification you could do. I believe this is what you want:
function scoring() {
var score_yes = $(".yes:checked").size();
var score_no = $(".no:checked").size();
if (score_yes == 3) {
$("#result").html('LOW');
} else if (score_yes == 2) {
$("#result").html('MEDIUM');
} else if (score_no == 3) {
$("#result").html('HIGH');
} else if (score_no == 2) {
$("#result").html('HIGH');
} else {
$("#result").html('N/A');
}
}
$(document).ready(function () {
$(".yes, .no").change(function () {
scoring();
});
});