(^556) Chapter 14 A Brief Look at JavaScript
Figure 14.17
The browser on the
left shows the
prompt box and
input; the browser
on the right shows
the alert box
displayed after the
input
quantity = prompt("Please type a quantity greater than 0");
if (quantity <= 0)
{
alert("Quantity is not greater than 0.");
} else {
alert("Thank you for entering a quantity greater than 0.");
} // end if
} // end function promptQuantity
// ]]> -->
Using JavaScript
onclick="promptQuantity();" />