forked from bethrobson/Head-First-JavaScript-Programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathimage.html
More file actions
27 lines (25 loc) · 508 Bytes
/
image.html
File metadata and controls
27 lines (25 loc) · 508 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title> Image Guess </title>
<style>
body { margin: 20px; }
img { margin: 20px; } /* added in second step */
</style>
<script>
window.onload = init;
function init() {
var image = document.getElementById("zero");
image.onclick = showAnswer;
};
function showAnswer() {
var image = document.getElementById("zero");
image.src = "zero.jpg";
}
</script>
</head>
<body>
<img id="zero" src="zeroblur.jpg">
</body>
</html>