forked from OnlyAHuman7926/Clock
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
54 lines (50 loc) · 1.28 KB
/
Copy pathindex.html
File metadata and controls
54 lines (50 loc) · 1.28 KB
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>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>replit</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div>
请输入考试开始时间:
</div>
<div>
<input id="start-hour" type="number">时<br>
<input id="start-min" type="number">分<br>
<!--<input id="sec" type="number">秒-->
</div>
<div>
请输入考试结束时间:
</div>
<div>
<input id="end-hour" type="number">时<br>
<input id="end-min" type="number">分<br>
<!--<input id="sec" type="number">秒-->
</div>
<button id="submit">提交</button>
<script>
submit.onclick = () => {
let now = new Date();
let start = +new Date(
now.getFullYear(),
now.getMonth(),
now.getDate(),
+document.getElementById("start-hour").value,
+document.getElementById("start-min").value,
0
)
let finish = +new Date(
now.getFullYear(),
now.getMonth(),
now.getDate(),
+document.getElementById("end-hour").value,
+document.getElementById("end-min").value,
0
);
window.location.href = `./clock.html?startTime=${start}&finishTime=${finish}`;
}
</script>
</body>
</html>