vendredi 14 août 2015

Count clicked checkboxes, even after refresh

I am trying to keep count of how many times the check boxes have been clicked on my site, the check boxes are used for filters (for men, women, age, etc). At the moment I have this code

jQuery('[id^="checkbox"] input').each(
    function (index, element) {
        jQuery(this).click(
            function () {
                console.debug("Hello");
            }
        );
    }
);

Which will count (in console) how many times a check box has been click (with an id starting with checkbox), but because the page refreshes the information (and url) with each click, it will only count the first click, and the rest will not be counted. Is there anyway to carry on counting after the page has been refreshed? Thanks




Aucun commentaire:

Enregistrer un commentaire