-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
56 lines (41 loc) · 1.35 KB
/
index.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
55
56
<!DOCTYPE html>
<html>
<head>
<title>2023-05-22作业</title>
<meta charset="utf-8">
<style>
.grid {
display: grid;
grid-template-columns: repeat(2, 200px);
grid-template-rows: repeat(2, 200px);
gap: 10px;
align-items: center;
justify-items: center;
}
.merged-cell {
grid-row: span 2;
}
</style>
</head>
<body>
<div id="icc">
<div class="grid">
<div>
<input type="range" id="volume" min="1" max="5" oninput="updatedValue()">
</div>
<div id="mergedCell" class="merged-cell">
<input type="range" id="cowbell" min="2" max="10" step="1" oninput="updatedValue()">
</div>
<div id="numberValue"></div>
</div>
</div>
</body>
<script>
function updatedValue() {
let volume = document.getElementById('volume').value;
let cowbell = document.getElementById('cowbell').value;
let number = parseInt(volume) * parseInt(cowbell);
document.getElementById('numberValue').textContent = 'Number: ' + number;
}
</script>
</html>