-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathinnertext.html
54 lines (50 loc) · 1.29 KB
/
innertext.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
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<html>
<head>
<style>
body{
background-image: linear-gradient(to right, navy, royalblue);
color: white;
}
.MyDiv{
align-items: center;
justify-content: center;
width:80%;
height: 300px;
background-color: black;
}
.MyDiv2{
align-items: center;
justify-content: center;
width:80%;
height: 300px;
background-color: white;
color:black;
}
#demotext{
padding: 50px;
}
#demotext2{
padding: 50px;
}
</style>
<script>
function changetext() {
document.getElementById("demotext").innerHTML = "You have clicked the button!";
}
function date() {
document.getElementById('demotext2').innerHTML = Date();
}
</script>
</head>
<body>
<center><div class="MyDiv">
<p id="demotext">Hello Everyone</p>
<button onclick="changetext()">Click Me to Change the above Text</button></div>
</center>
<center><div class="MyDiv2">
<p id="demotext2">Clik the button to display date over here</p>
<button onclick="date()">Click Me to display date</button></div>
</center>
</body>
</html>