Skip to content

Commit cfe9c71

Browse files
committed
Added events examples
1 parent dd00ac5 commit cfe9c71

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

events.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!doctype html>
2+
<html>
3+
<head>
4+
<title>The JavaScript DOM</title>
5+
</head>
6+
<body>
7+
8+
<h1 id="heading">The JavaScript DOM</h1>
9+
10+
<p id="paragraph">Mauris convallis dictum odio. Quisque euismod finibus.</p>
11+
12+
<a id="link" href="https://codeadam.ca">codeadam.ca</a>
13+
14+
<button id="button">Click Me!</button>
15+
16+
<script>
17+
18+
var button = document.getElementById('button');
19+
20+
button.addEventListener("click",function(){
21+
document.getElementById("heading").style.color = "red";
22+
});
23+
24+
</script>
25+
26+
</body>
27+
</html>

0 commit comments

Comments
 (0)