I have this script where checkbox behave like radio button:
$(".chb").each(function () {
$(this).change(function () {
$(".chb").prop('checked',false);
$(this).prop('checked', true);
});
});
I have this loop in view:
@foreach (var item in Model.Banners)
{
<tr>
<td style="border-right:1px solid white;border-bottom:1px solid white;padding:5px;">@Html.CheckBoxFor(m => m.PayIn.CheckedPayIn, new {id="payin", @class = "chb" })</td>
</tr>
}
How can i check in jquery if and which one is checked? I tried this but no success:
if ($(this).prop("checked") == false)
{
alert("false");
}