JavaScript Age Verifier....

How would I write a program, in JavaScript...that is like a password application; when the person would click on the link a box would pop up, and ask them for their age.  If they were not 18 or older it would send them to another site...but everyone older than 18 it would let them onto that part of the site, how would I write this; or can someone maybe write one for me?
CyberMageAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
anguslaiConnect With a Mentor Commented:
Use the following code ;

<A href="ove18.html"
onClick="age=prompt('please enter your age:',''); if(age>=18) { return true; } else { window.location='http://www.experts-exchange.com/'; return false}">
Click Here</a>


0
All Courses

From novice to tech pro — start learning today.