Simple page for Javascript Demo

This text was created by HTML.


<script language="JavaScript">
var age;

age = parseInt(window.prompt("Enter your age","18"));
document.write("According to US law, at the age of " + age +
                " you can drive ");

if (age >= 21) {
  document.write("to a bar<br>");
  window.alert("Use a designated driver");
  }
else if (age >= 18)
  document.write("a tank<br>");
else if (age >= 16)
  document.write("a car<br>");
else
  document.write("your parents crazy<br>");
</script>