回答編集履歴
4
追記
test
CHANGED
@@ -14,15 +14,13 @@
|
|
14
14
|
|
15
15
|
```
|
16
16
|
|
17
|
-
[サンプル](https://codepen.io/asuchi0819/pen/eYYyQqv)
|
18
|
-
|
19
17
|
|
20
18
|
|
21
19
|
---
|
22
20
|
|
23
21
|
|
24
22
|
|
25
|
-
完全蛇足です。
|
23
|
+
完全蛇足です。スマートに書くとこうなります。
|
26
24
|
|
27
25
|
```JavaScripr
|
28
26
|
|
@@ -63,3 +61,5 @@
|
|
63
61
|
|
64
62
|
|
65
63
|
```
|
64
|
+
|
65
|
+
[サンプル](https://codepen.io/asuchi0819/pen/eYYyQqv)
|
3
追記
test
CHANGED
@@ -15,3 +15,51 @@
|
|
15
15
|
```
|
16
16
|
|
17
17
|
[サンプル](https://codepen.io/asuchi0819/pen/eYYyQqv)
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
---
|
22
|
+
|
23
|
+
|
24
|
+
|
25
|
+
完全蛇足です。
|
26
|
+
|
27
|
+
```JavaScripr
|
28
|
+
|
29
|
+
|
30
|
+
|
31
|
+
timerCount = 0;
|
32
|
+
|
33
|
+
function start() {
|
34
|
+
|
35
|
+
timerId = setInterval(function(){
|
36
|
+
|
37
|
+
timerCount++;
|
38
|
+
|
39
|
+
document.getElementById("timer").textContent = timerCount / 10;
|
40
|
+
|
41
|
+
},100);
|
42
|
+
|
43
|
+
}
|
44
|
+
|
45
|
+
|
46
|
+
|
47
|
+
function stop() {
|
48
|
+
|
49
|
+
clearInterval(timerId);
|
50
|
+
|
51
|
+
}
|
52
|
+
|
53
|
+
|
54
|
+
|
55
|
+
function reset() {
|
56
|
+
|
57
|
+
document.getElementById('timer').textContent = '0.0';
|
58
|
+
|
59
|
+
timerCount = 0;
|
60
|
+
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
|
65
|
+
```
|
2
追記
test
CHANGED
@@ -15,49 +15,3 @@
|
|
15
15
|
```
|
16
16
|
|
17
17
|
[サンプル](https://codepen.io/asuchi0819/pen/eYYyQqv)
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
---
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
完全蛇足ですがスマートに書くとこうなります。
|
28
|
-
|
29
|
-
```JavaScript
|
30
|
-
|
31
|
-
function start() {
|
32
|
-
|
33
|
-
timerId = setInterval(function(){
|
34
|
-
|
35
|
-
timerCount += 0.1;
|
36
|
-
|
37
|
-
document.getElementById("timer").textContent = Math.round(timerCount * 10) / 10;
|
38
|
-
|
39
|
-
},100);
|
40
|
-
|
41
|
-
}
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
function stop() {
|
46
|
-
|
47
|
-
clearInterval(timerId);
|
48
|
-
|
49
|
-
}
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
function reset() {
|
54
|
-
|
55
|
-
document.getElementById('timer').textContent = '0.0';
|
56
|
-
|
57
|
-
timerCount = 0;
|
58
|
-
|
59
|
-
}
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
```
|
1
追記
test
CHANGED
@@ -15,3 +15,49 @@
|
|
15
15
|
```
|
16
16
|
|
17
17
|
[サンプル](https://codepen.io/asuchi0819/pen/eYYyQqv)
|
18
|
+
|
19
|
+
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
---
|
24
|
+
|
25
|
+
|
26
|
+
|
27
|
+
完全蛇足ですがスマートに書くとこうなります。
|
28
|
+
|
29
|
+
```JavaScript
|
30
|
+
|
31
|
+
function start() {
|
32
|
+
|
33
|
+
timerId = setInterval(function(){
|
34
|
+
|
35
|
+
timerCount += 0.1;
|
36
|
+
|
37
|
+
document.getElementById("timer").textContent = Math.round(timerCount * 10) / 10;
|
38
|
+
|
39
|
+
},100);
|
40
|
+
|
41
|
+
}
|
42
|
+
|
43
|
+
|
44
|
+
|
45
|
+
function stop() {
|
46
|
+
|
47
|
+
clearInterval(timerId);
|
48
|
+
|
49
|
+
}
|
50
|
+
|
51
|
+
|
52
|
+
|
53
|
+
function reset() {
|
54
|
+
|
55
|
+
document.getElementById('timer').textContent = '0.0';
|
56
|
+
|
57
|
+
timerCount = 0;
|
58
|
+
|
59
|
+
}
|
60
|
+
|
61
|
+
|
62
|
+
|
63
|
+
```
|