I would like to ask what's wrong with this code, it seems legit to me.
When I select the radio button, my radioMininum
still remains 0
.
var radioMinimum=0;
$('#mMininum').click(function(){
if($(this).is(':checked')){
radioMinimum = 1;
alert(radioMinimum);
}
else{
radioMinimum=0;
alert(radioMinimum);
}
});
alert(radioMinimum);
inside the if-else the radioMinimum displays correctly. like if checked,its 1. but the bottom alert-outside .click radioMinimum still displays 0.