-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTask-1.html
More file actions
35 lines (35 loc) · 931 Bytes
/
Task-1.html
File metadata and controls
35 lines (35 loc) · 931 Bytes
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
<html>
<head>
<title></title>
<style>
.a{
border: 0px solid white;
width: 500px;
margin: auto;
}
button{
margin: 4px;
}
</style>
</head>
<body>
<div class="a">
<button onclick="f1()">Show Date</button>
<div id="i1"></div>
<button onclick="f2()">Show Time</button>
<div id="i2"> </div>
</div>
<script>
function f1(){
let d = new Date();
var a=d.getDate()+"/"+(d.getUTCMonth()+1)+"/"+d.getFullYear();
document.getElementById('i1').innerHTML=a;
}
function f2()
{
let t= new Date();
document.getElementById('i2').innerHTML=t;
}
</script>
</body>
</html>