views:

96

answers:

2

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?

+3  A: 
$("#MyStatus").is(":checked");
Josh Stodola
A: 

How to check if checkbox is checked using jQuery http://jquery-howto.blogspot.com/2008/12/how-to-check-if-checkbox-is-checked.html

easement