-
Notifications
You must be signed in to change notification settings - Fork 0
/
i4.html
38 lines (31 loc) · 1.09 KB
/
i4.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<section id="content">
<h1 id="heading">Hello From Interactive Cares...</h1>
<h2 class="bold">This is a heading</h2>
<p class="bold">Welcome to our DOM Class</p>
<p class="bold">Today we are going to learn about DOM</p>
<p class="bold">DOM stands for Document Object Model</p>
<p>This is a normal Paragraph</p>
</section>
<p id="footer">Copyright</p>
<div>Hello Hello</div>
<button style="margin-top:10px;" id="click">Make Bold</button>
<script>
const button = document.getElementById('click')
button.addEventListener('click', function () {
// const elements = document.querySelector("p.bold")
const elements = document.querySelectorAll("p.bold")
elements.forEach(element => {
element.innerHTML = `<em>${element.innerHTML}</em>`
})
})
</script>
</body>
</html>