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:
document.getElementById('confirm-age').onclick = function() localStorage.setItem('ageVerified', 'true'); document.getElementById('age-verification-modal').style.display = 'none'; ;
Paste this (customize the age threshold and link):
const lastCheck = localStorage.getItem('ageVerifiedDate'); const today = new Date().toDateString(); if(lastCheck !== today) // show modal
And on confirm: