I've given 3 radio boxes as below,
<input type="radio" class="minimal" name="statusFilter" value="1" autocomplete="off">
<input type="radio" class="minimal" name="statusFilter" value="2" autocomplete="off">
<input type="radio" class="minimal" name="statusFilter" value="3" autocomplete="off">
Here, I need to hide an element if the radio button with value 2 is checked. I've tried with the below code but 'hide is active for all the radio buttons.
$('input[name="statusFilter"]').each(function() {
if ($(this).val() == 2) {
alert('test');
$('#btn-create-proforma').hide();
}
});