Created
November 28, 2014 03:06
-
-
Save leachy14/d1f5873445c0db27de32 to your computer and use it in GitHub Desktop.
A small JavaScript program to see if you can drink in the United States
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<DOCTYPE HTML> | |
<html> | |
<head> | |
<title> Test </title> | |
</head> | |
<body> | |
<h1> This is a page used to test javascript </h1> | |
<script> | |
alert("Im going tell you if you can drink in a bar or not, Please enter your age."); | |
var age = prompt("What is your age?"); | |
if ( age < 21) { | |
alert("Sorry bud you can't drink"); | |
} else { | |
alert("Bottoms up mate!"); | |
} | |
</script> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment