Semester 3 pog
This commit is contained in:
25
Semester 1/Chapter ZIPs/JavaScript/ch04/ex_4_21.html
Executable file
25
Semester 1/Chapter ZIPs/JavaScript/ch04/ex_4_21.html
Executable file
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 4.21</title>
|
||||
<script>
|
||||
function getBracelet()
|
||||
{
|
||||
var bracelets = (prompt("How many bracelets do you want?"," "));
|
||||
while (isNaN(bracelets) || (bracelets < 0))
|
||||
{
|
||||
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> </h2>
|
||||
<h1>Order Your Bracelets Now!</h1>
|
||||
<p><input type="button" id="bracelets" value="Order bracelets" onclick="getBracelet();" /></p>
|
||||
</td></tr>
|
||||
</table></body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user