Checkbox to enable or disable a list box
问题 I have a checkbox on my ASP.NET MVC page that I create like: <div> @Html.CheckBoxFor(m => m.allUsers, new { Name = "allUsersCheck" }) @Html.LabelFor(m => m.allUsers) </div> I also have a listbox that I create with: @Html.ListBoxFor(x => x.selectedUsers, Model.ListofUsers, new { style = "width:200px", size = 10, Id = "lbUsers" }) I have this following script (which I wrote to disable the listbox when my checkbox is checked. I can't understand why it doesn’t work. Can someone point out what's