I'm using jQuery to show and hide a div. But even in true case else condition executes. I wonder what is my mistake. Thanks for any help in advance.
$(".budget").on("change",function () {
var radioValue = $(".budget:checked").val();
if (radioValue=="haveBudget") {
alert($(this).val());
} else {
alert("else part");
}
});
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<input type="radio" name="pref" class="budget" value="haveBudget" />
<input type="radio" name="pref" class="budget" value="10" />