1
+ <!DOCTYPE html>
2
+ < html lang ="en ">
3
+
4
+ < head >
5
+ < meta charset ="UTF-8 " />
6
+ < meta name ="viewport " content ="width=device-width, initial-scale=1.0 " />
7
+ < title > 🏴‍☠️ Complete Javascripts Course</ title >
8
+ < link href ="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css " rel ="stylesheet "
9
+ integrity ="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh " crossorigin ="anonymous " />
10
+ <!-- <style>
11
+ td {
12
+ border: 1px solid #ddd;
13
+ padding: 10px;
14
+ border-radius: 15px;
15
+ }
16
+ </style> -->
17
+ </ head >
18
+
19
+ < body >
20
+ < br />
21
+ < br />
22
+ < center >
23
+ <!-- <input type="text" id="item"> -->
24
+ < br />
25
+ < div id ="wrapper "> 📃 🏪 👾</ div >
26
+ < br />
27
+ < div id ="message "> Complete JavaScript Course</ div >
28
+ < div id ="message1 "> </ div >
29
+ < input type ="date " onchange ="start() " />
30
+
31
+ < br /> < br />
32
+ </ center >
33
+ < script >
34
+ var message = document . getElementById ( "message" ) ;
35
+ var message1 = document . getElementById ( "message1" ) ;
36
+ var output = document . getElementById ( "message1" ) ;
37
+ var cDate , eDate , s , m , h , d , t ;
38
+
39
+ function start ( ) {
40
+ var tDate = event . target . valueAsDate ;
41
+ message . innerHTML = tDate ;
42
+ eDate = new Date ( tDate ) ;
43
+ outputUpdate ( ) ;
44
+ t = window . setTimeout ( update , 1000 ) ;
45
+ }
46
+
47
+ function update ( ) {
48
+ outputUpdate ( ) ;
49
+ t = window . setTimeout ( update , 1000 ) ;
50
+ }
51
+
52
+ function outputUpdate ( ) {
53
+ cDate = new Date ( ) ;
54
+ var dur = eDate - cDate ;
55
+ s = Math . floor ( ( dur % ( 1000 * 60 ) ) / 1000 ) ;
56
+ s = s < 10 ? "0" + s : s ;
57
+ m = Math . floor ( ( dur % ( 1000 * 60 * 60 ) ) / ( 1000 * 60 ) ) ;
58
+ m = m < 10 ? "0" + m : m ;
59
+ h = Math . floor ( ( dur % ( 1000 * 60 * 60 * 24 ) ) / ( 1000 * 60 * 60 ) ) ;
60
+ d = Math . floor ( dur / ( 1000 * 60 * 60 * 24 ) ) ;
61
+ output . innerHTML = d + " : " + h + " : " + m + " : " + s ;
62
+ }
63
+ </ script >
64
+
65
+ < script src ="https://code.jquery.com/jquery-3.5.0.js "
66
+ integrity ="sha256-r/AaFHrszJtwpe+tHyNi/XCfMxYpbsRg2Uqn0x3s2zc= " crossorigin ="anonymous "> </ script >
67
+ < script src ="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.min.js "> </ script >
68
+ < script src ="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/js/bootstrap.bundle.min.js "> </ script >
69
+ </ body >
70
+
71
+ </ html >
0 commit comments