@Html.checkboxfor - Get checkbox value using id
问题 In my application, user has a choice to check or uncheck a field "Right". I could able to set the model values to the checkbox using @html.checkboxfor @Html.CheckBoxFor(x => x.Right, new { id="right"}) Can someone help me how to get the value using the id. For now i am using $("#right").val() to get the value. But it is not working. Someone please help me to solve this issue. 回答1: Use: $("#right").prop('checked') OR $("#right").is(":checked") 回答2: You can get the checked checkbox values like