forked from paylike/sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path!DOCTYPE html.txt
58 lines (53 loc) · 1.36 KB
/
!DOCTYPE html.txt
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
57
58
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Table Increment Example</title>
<style>
.button {
width: 30px;
height: 30px;
border-radius: 50%;
border: 2px solid #000;
background-color: #f0f0f0;
display: inline-flex;
align-items: center;
justify-content: center;
font-size: 18px;
cursor: pointer;
}
</style>
</head>
<body>
<table border="1" cellpadding="10">
<tr>
<th>Row</th>
<th>Action</th>
<th>Value</th>
<th>Action</th>
</tr>
<tr>
<td>2</td>
<td><div class="button" onclick="decreaseNumber()">-</div></td>
<td id="tableValue">0</td>
<td><div class="button" onclick="increaseNumber()">+</div></td>
</tr>
</table>
<script>
let value = 0;
function increaseNumber() {
if (value < 5) {
value++;
document.getElementById('tableValue').textContent = value;
}
}
function decreaseNumber() {
if (value > 0) {
value--;
document.getElementById('tableValue').textContent = value;
}
}
</script>
</body>
</html>