My code is working, except location.reload(); is not working. My purpose is to reload the page after unchecking the last checkbox.
location.reload();