- Get link
- X
- Other Apps
Posts
- Get link
- X
- Other Apps
- Get link
- X
- Other Apps
const ageRestrictionPopup = document.getElementById("age-restriction-popup"); const yesButton = document.querySelector(".btn-yes"); const noButton = document.querySelector(".btn-no"); function showAgeRestrictionPopup() { ageRestrictionPopup.style.display = "flex"; } function hideAgeRestrictionPopup() { ageRestrictionPopup.style.display = "none"; } yesButton.addEventListener("click", function() { // Handle the action for the "Yes" button hideAgeRestrictionPopup(); }); noButton.addEventListener("click", function() { // Handle the action for the "No" button window.location.href = "https://www.google.com/"; // redirect to google as an example }); // Show the age restriction popup when the page loads showAgeRestrictionPopup();
Skip to main content