-
Notifications
You must be signed in to change notification settings - Fork 0
/
i6.html
44 lines (40 loc) · 1.28 KB
/
i6.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
39
40
41
42
43
44
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<style>
/* h1{
color: red;
font-size:50px;
} */
</style>
</head>
<body>
<section id="s1">
<h1 id="heading1">This is section one</h1>
<p>Paragraph one in section one</p>
<p>Paragraph two in section one</p>
<p>Paragraph three in section one</p>
</section>
<section id="s2" style="background-color: red; color:white; padding: 10px; width:250px">
<h2 id="heading2">This is section two</h2>
<p>Paragraph one in section two</p>
<p>Paragraph two in section two</p>
<p>Paragraph three in section two</p>
</section>
<button style="margin-top:10px;" id="click">Modify</button>
<script>
const button = document.getElementById('click')
button.addEventListener('click',function(){
const h1 = document.getElementById('heading1')
h1.style.color = 'red'
h1.style.fontSize = '50px'
const s2 = document.getElementById('s2')
s2.style.backgroundColor = 'green'
s2.style.borderRadius = '20px'
})
</script>
</body>
</html>