Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

I need some help

Aaron StephenAaron Stephen Member Posts: 2

How would you code this to make it where you type in the answer to a text box and click a button to submit it?

<

script>

var age=prompt('Enter your age.');

if (age<21)
    {

    alert('You\'re too young. Please leave now.');
    }
else if (age>21)
    {
    alert('Wow you\'re way to old to come in the club!');
    }
else 
    {
    alert('Welcome to our exclusive club.');
    }


Tagged:
Sign In or Register to comment.