Search This Blog

Saturday 25 May 2019

How to Reset Group Radio Button using jQuery

Step 1: MVC RadioButton

@Html.Label("Are you alcoholic?") 
@Html.RadioButton("GroupRadio", "Yes") @Html.Label("Yes")
@Html.RadioButton("GroupRadio", "No") @Html.Label("No")

Step 2: Get Selected value from RadioButton

$("input[name='GroupRadio']:checked").val();

Step 3: Reset RadioButton

$("input[name='GroupRadio']").prop("checked", false);

No comments:

Post a Comment