Reputation: 25553
I have following html control in view:
<%= Html.CheckBox("MyStatus", (item.MyStatus>0)?true:false)%>
Then I want to get the value for this checkbox: if it is checked, return true, otherwise return false. I try it as below:
$("#MyStatus").attr("checked").value
but I can't get the right value.
How to resolve it?
Upvotes: 2
Views: 355
Reputation: 6139
How to check if checkbox is checked using jQuery http://jquery-howto.blogspot.com/2008/12/how-to-check-if-checkbox-is-checked.html
Upvotes: 0