Reputation: 25583
There is a checkbox created by html helper in MVC view:
<%= Html.CheckBox("Choice", false)%>
Then Want to get the checking status of this this checkbox in js using jquery, how to write the code?
Upvotes: 0
Views: 4015
Reputation: 2502
if($('#Choice').is(':checked')) {
//is checked
} else {
//is not checked
}
or you might even be able to do
if($('#Choice:checked')) {
//is checked
} else {
//is not checked
}
Upvotes: 1