Skip to content

Commit 52495df

Browse files
author
Sonyl Nagale
committed
Hello DOM example
1 parent 52e7b91 commit 52495df

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

chapter-6/hello/index.html

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<!DOCTYPE html>
2+
<html lang="en" dir="ltr">
3+
4+
<head>
5+
<meta charset="utf-8">
6+
<title></title>
7+
</head>
8+
9+
<body>
10+
<p></p>
11+
<button>Click me!</button>
12+
<script src="index.js"></script>
13+
</body>
14+
15+
</html>

chapter-6/hello/index.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
document.querySelector('button').addEventListener('click', (e) => {
2+
document.querySelector('p').innerHTML = `Hello! It is currently ${new Date()}.`
3+
})

0 commit comments

Comments
 (0)