Skip to content

Commit 89fe0b7

Browse files
committed
adding code for chapter 6
1 parent c5f96c6 commit 89fe0b7

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

chapter6/code.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
var access = document.getElementById("code9");
2+
var code = access.innerHTML;
3+
code = code + " midnight";
4+
alert(code);

chapter6/drevel.html

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
<!doctype html> <html lang="en">
2+
<head>
3+
<meta charset="utf-8">
4+
<title>Dr. Evel's Secret Code Page</title>
5+
</head>
6+
<body>
7+
<p id="code1">The eagle is in the</p>
8+
<p id="code2">The fox is in the</p>
9+
<p id="code3">snuck into the garden last night.</p>
10+
<p id="code4">They said it would rain</p>
11+
<p id="code5">Does the red robin crow at</p>
12+
<p id="code6">Where can I find Mr.</p>
13+
<p id="code7">I told the boys to bring tea and</p>
14+
<p id="code8">Where's my dough? The cake won't</p>
15+
<p id="code9">My watch stopped at</p>
16+
<p id="code10">barking, can't fly without umbrella.</p> <p id="code11">The green canary flies at</p>
17+
<p id="code12">The oyster owns a fine</p>
18+
<script src="code.js"></script>
19+
</body>
20+
</html>

chapter6/planets.html

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!doctype html> <html lang="en"> <head>
2+
<title>Planets</title>
3+
<meta charset="utf-8">
4+
<style>
5+
.redtext { color: red; }
6+
</style>
7+
</head>
8+
<body>
9+
<h1>Green Planet</h1>
10+
<p id="greenplanet">All is well</p>
11+
<h1>Red Planet</h1>
12+
<p id="redplanet">Nothing to report</p>
13+
<h1>Blue Planet</h1>
14+
<p id="blueplanet">All systems A-OK</p>
15+
<script>
16+
function init() {
17+
var planet = document.getElementById("greenplanet");
18+
planet.innerHTML = "Red Alert: hit by phaser fire!";
19+
planet.setAttribute("class", "redtext");
20+
}
21+
window.onload = init;
22+
</script>
23+
</body>
24+
</html>

0 commit comments

Comments
 (0)