-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchapter3.html
More file actions
51 lines (51 loc) · 1.28 KB
/
chapter3.html
File metadata and controls
51 lines (51 loc) · 1.28 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Shopping list</title>
<style>
p{
color: yellow;
font-family: "arial",sans-serif;
font-size: 1.2em;
}
body{
color: white;
background-color: black;
}
.special{
font-style: italic
}
h2.special{
text-transform: uppercase;
}
#purchases{
border: 1px solid white;
background-color: #333;
color: #ccc;
padding: 1.7em;
}
#purchases li{
font-weight: bold;
font-size: 1.5em;
}
</style>
</head>
<body>
<h1>What to buy</h1>
<p title="a gentle reminder">Don't forgot to buy this stuff.</p>
<ul id="purchases">
<li>A tin of beans</li>
<li class="sale">Cheese</li>
<li class="sale important">Milk</li>
</ul>
<p class="special">This is a special paragraph</p>
<h2 class="special"> So does this headline.</h2>
<script>
var foo=document.getElementById("purchases")
alert(foo.getAttribute("title"))
foo.setAttribute("title","new add title!")
alert(foo.getAttribute("title"))
</script>
</body>
</html>