Streaming live at 10am (PST)

Need help creating an age gate for website in javascript


#1

Hey guys, I tried out a few example codes out there for adding an age gate to my website, but with little success. Using the below code, I was able to get some parts of the age gate to show, but I couldn't get the the age check function to work, as the options never showed!. frowning
Could you guys help me out? Thanks!


#2

Hi @Nick1

Would it be possible to use simple interactions instead of custom code?

Like:

Are you older than 18?

[Button Yes] [Button No]

If someone clicks the YES button, then the overlay/modal disappears. If they click no, they go to disney.com or something.


#3

That almost works, but I would really like it to be in JS, so I can make use of cookies.


#4

What if you added custom code to hook to those buttons. something like

$('.btn-yes').on('click', function(){ //do cookie stuff })

#5

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.