-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.html
More file actions
42 lines (36 loc) · 735 Bytes
/
test.html
File metadata and controls
42 lines (36 loc) · 735 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
36
37
38
39
40
41
42
<!DOCTYPE html>
<html lang="en">
<head>
<title></title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
padding: 100px;
}
button {
font-size: 30px;
margin: 10px;
background: none;
border: 1px solid gray;
}
button:active {
opacity: 0.7;
}
</style>
</head>
<body>
<div class="num" style="font-size:100px">0</div>
</body>
<script>
var num = document.querySelector('.num')
for (let i = 1; i <= 10; i++) {
var doc = document.createElement('button')
doc.innerHTML = i
doc.onclick = function () {
num.innerHTML = i
}
document.body.appendChild(doc)
}
</script>
</html>