I have a small piece of code that I want to use as a condition for a jQuery dialog. Pretty simple case, if checkboxes are checked, enable button, if not, disable it. The below code disables the button just fine, but does not enable it when checking any checkboxes.
I tried multiple variations and I cannot get this to work in my code (several work fine in Fiddle). Many thanks for your help.
JS snippet
if (button.text() == "Apply") {
if ($("selectLocation").is(':checked'))
button.enabled(true); // checked
else
button.enabled(false); // unchecked
}
HTML
<input type="checkbox" name="selectLocation" />