forked from bethrobson/Head-First-JavaScript-Programming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplanets.html
More file actions
26 lines (26 loc) · 558 Bytes
/
planets.html
File metadata and controls
26 lines (26 loc) · 558 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
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Planets</title>
<style>
.redtext { color: red; }
</style>
</head>
<body>
<h1>Green Planet</h1>
<p id="greenplanet">All is well</p>
<h1>Red Planet</h1>
<p id="redplanet">Nothing to report</p>
<h1>Blue Planet</h1>
<p id="blueplanet">All systems A-OK</p>
<script>
function init() {
var planet = document.getElementById("greenplanet");
planet.innerHTML = "Red Alert: hit by phaser fire!";
planet.setAttribute("class", "redtext");
}
window.onload = init;
</script>
</body>
</html>