Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save drewbrokke/516fdf70d7ec41177b3f210fec349ff0 to your computer and use it in GitHub Desktop.
Save drewbrokke/516fdf70d7ec41177b3f210fec349ff0 to your computer and use it in GitHub Desktop.
document.querySelectorAll('input[type="checkbox"][value="indeterminate"]') .forEach(function(checkbox) {
checkbox.indeterminate = true;
let onchangeHandler = function() {
checkbox.value = '';
checkbox.removeEventListener('change', onchangeHandler);
}
checkbox.addEventListener('change', onchangeHandler);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment