SoFunction
Updated on 2025-04-10

jquery method to determine that at least one checkbox is selected

This article example describes the method of jquery to determine that at least one checkbox is selected. Share it for your reference. The specific implementation method is as follows:

html code part:

<form>
  <!-- bunch of checkboxes like: -->
  <input type="checkbox" ... >
  <input type="checkbox" ... >
  <!-- submit button, defaults to disabled -->
  <input type="submit" value="submit">
</form>

jquery code part:

var checkboxes = $("input[type='checkbox']"),
  submitButt = $("input[type='submit']");
(function() {
  ("disabled", !(":checked"));
});

I hope this article will be helpful to everyone's jQuery programming.