Skip to content

Instantly share code, notes, and snippets.

@accidentaldeveloper
Last active November 10, 2015 22:01
Show Gist options
  • Save accidentaldeveloper/4e914940ac2f8b5f4537 to your computer and use it in GitHub Desktop.
Save accidentaldeveloper/4e914940ac2f8b5f4537 to your computer and use it in GitHub Desktop.
Display number of sessions selected
(function () {
var $regularSessionsPane = $("#regularsessions");
$regularSessionsPane.prepend('<div>Sessions Selected: <span id="myCount"><\span><\div>')
var $checkboxes = $regularSessionsPane.find("input[type='checkbox']");
var $countDisplay = $("#myCount");
$checkboxes.change(function() {
var count = $checkboxes.filter(":checked").length;
$countDisplay.text(count);
});
$checkboxes.change();
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment