Skip to content

Commit 0afbd22

Browse files
authored
added button and an event listener
1 parent c24cfd5 commit 0afbd22

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

index.html

+7-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,13 @@
22
<html>
33

44
<head>
5+
6+
</head>
57
<body>
6-
<h2>NN</h2>
8+
<button type"button" id="btn1"></button>
9+
<p1 id="p1"></p1>
10+
<script type="javascript">document.getElementById("btn1").addEventListener("click",function(){
11+
document.getElementById("p1").innerHTML = "hello";
12+
});</script>
713
</body>
8-
</head>
914
</html>

0 commit comments

Comments
 (0)