-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathday7.1.html
More file actions
33 lines (27 loc) · 725 Bytes
/
Copy pathday7.1.html
File metadata and controls
33 lines (27 loc) · 725 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
28
29
30
31
32
33
<!DOCTYPE HTML>
<html>
<head>
<title>7.1</title>
<style type="text/css" media="screen">
.indent { text-indent: 20px; }
</style>
<script type="text/javascript" charset="utf-8">
var indentPara = function() {
var para = document.getElementsByTagName('p');
var trigger = document.getElementById('trigger');
trigger.onclick = function() {
for (var i=0; i < para.length; i++) {
para[i].className = "indent";
};
}
}
window.onload = indentPara;
</script>
</head>
<body class="wrap">
<button id="trigger">click me</button>
<p>This is the first paragraph, you should indent me.</p>
<p>This is the second paragraph, you should indent me.</p>
<p>This is the third paragraph, you should indent me.</p>
</body>
</html>