ASDV-WebDev/Semester 1/Chapter ZIPs/JavaScript/ch04/ex_4_20.html

26 lines
683 B
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title>Example 4.20</title>
<script>
function getBracelet()
{
var bracelets = (prompt("How many bracelets do you want?"," "));
while (isNaN(bracelets))
{
bracelets = prompt("Please enter a positive number. How many bracelets do you want?"," ");
}
document.write("You are ordering " + bracelets + " bracelets. Thank you!");
}
</script>
</<head>
<body>
<table align ="center" width ="70%"><tr><td colspan ="2">
<h1>&nbsp;</h2>
<h1>Order Your Bracelets Now!</h1>
<p><input type="button" id="bracelets" value="Order bracelets" onclick="getBracelet();" /></p>
</td></tr>
</table></body>
</html>