const lastCheck = localStorage.getItem('ageVerifiedDate'); const today = new Date().toDateString(); if(lastCheck !== today) // show modal
document.getElementById('deny-age').onclick = function() window.location.href = 'https://www.google.com'; // Redirect away ; </script> The above remembers verification via browser localStorage . To reset daily, replace the if condition with: age verification squarespace
Paste this (customize the age threshold and link): const lastCheck = localStorage