Please help me! I am brand new and I don't even know where to start. I need to write a code that will break minors down to 4 categories: <=5, go to kindergarten; <=13 for take recess; 13 to 17 for teenagers; and >=16 for getting a drivers license. I've made a bunch of false starts but can't get to the first line! I get boggled trying to think it through because many of the categories overlap. Each child or parent should be prompted to enter the child's age. When the child's age is entered, the script should do a document.write that says something like: You are (age) so you should (whatever).
For instance, if 13 is entered for the age then an
heading should write out: You are 13 so you should take recess.
Here is as far as I can get:
<html>
<head>
<title>ages</title>
</head>
<script language="JavaScript" type="text/javascript"><!--
var visitor = prompt("Please enter your age.", "")
var age = "1"
if (age <= 5)
{
document.write("
You are ' So You Should:
")
}
//-->
</script>
</body>
</html>
I know it's not much, but I'm totally confused. Please help me. Thanks!
For instance, if 13 is entered for the age then an
heading should write out: You are 13 so you should take recess.
Here is as far as I can get:
<html>
<head>
<title>ages</title>
</head>
<script language="JavaScript" type="text/javascript"><!--
var visitor = prompt("Please enter your age.", "")
var age = "1"
if (age <= 5)
{
document.write("
You are ' So You Should:
")
}
//-->
</script>
</body>
</html>
I know it's not much, but I'm totally confused. Please help me. Thanks!
Comment