-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchap10assign.htm
More file actions
60 lines (44 loc) · 1.32 KB
/
chap10assign.htm
File metadata and controls
60 lines (44 loc) · 1.32 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
52
53
54
55
56
57
58
59
60
<html>
<head>
<title>Chapter 10 Assignment</title>
<script type="text/javascript">
function green()
{
document.body.style.background = "green";
}
function nogreen()
{
document.body.style.background = "white";
}
</script>
</head>
<body>
<h1>Event Handlers At Work!</h1>
<h2>By Natasha</h2>
<ol type="a">
<li><a id = "changeToGreen" href="http://www.Google.com">Search Here</a></li><br>
<li><form method="post">
<input style="background-color:lightgray" type="Button" name="" value="Click Me" onclick="alert('You clicked the button')"</form></li><br>
<li><form action="" method="post">My name is <input type="text" name="name" value="Sam" onchange="nameChange(this.value)"> Go ahead, change my name.</li><br>
<li><button style="background-color:lightgray" onclick="reloadPage()">Reload</button></li><br>
<li><button style="background-color:lightgray" onclick="favPage()">My Favorite Site</button></li>
</ol>
<script>
var greenLabel = document.getElementById("changeToGreen");
greenLabel.onmouseover= green;
greenLabel.onmouseout= nogreen;
function nameChange(newName)
{
alert("Name was changed to: "+newName);
}
function reloadPage()
{
location.reload();
}
function favPage()
{
window.open("http://www.procatinator.com");
}
</script>
</body>
</html>