ch04
This commit is contained in:
28
Chapter ZIPs/JavaScript/ch04/ex_4_16.html
Executable file
28
Chapter ZIPs/JavaScript/ch04/ex_4_16.html
Executable file
@@ -0,0 +1,28 @@
|
||||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
||||
<html>
|
||||
<head>
|
||||
<title>Example 4.16</title>
|
||||
<script>
|
||||
function countBeans()
|
||||
{
|
||||
var i = 0;
|
||||
beanImage = ("<img src = 'blue_bean.jpg' >");
|
||||
document.write("<table align = 'center'><tr><td>");
|
||||
document.write("<h1> <br /> Here are your beans:</h1>");
|
||||
for (i = 0; i <= 7; i++)
|
||||
document.write(beanImage + " ");
|
||||
document.write("</td></tr></table>");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<table align ="center" width ="70%"><tr><td colspan ="2">
|
||||
<h1> </h2>
|
||||
<h1>Count Beans!</h1>
|
||||
<tr><td><p> </p>
|
||||
<p><input type="button" id="beans" value="Click to count beans" onclick="countBeans();" /></p>
|
||||
</td></tr>
|
||||
</table>
|
||||
</body>
|
||||
</html>
|
||||
|
Reference in New Issue
Block a user