質問編集履歴
1
変数名を修正
test
CHANGED
File without changes
|
test
CHANGED
@@ -21,17 +21,17 @@
|
|
21
21
|
```
|
22
22
|
```JavaScript
|
23
23
|
window.addEventListener('load', function(){
|
24
|
-
const
|
24
|
+
const cost = document.getElementById("asset-retirement-cost");
|
25
|
-
const
|
25
|
+
const year = document.getElementById("year-of-use");
|
26
|
-
const
|
26
|
+
const interest = document.getElementById("interest");
|
27
|
-
const
|
27
|
+
const button = document.getElementById("button");
|
28
|
-
const
|
28
|
+
const presentValue = document.getElementById("present-value");
|
29
29
|
|
30
|
-
|
30
|
+
button.addEventListener('click', function() {
|
31
|
-
const inputCost =
|
31
|
+
const inputCost = cost.value;
|
32
|
-
const inputYear =
|
32
|
+
const inputYear = year.value;
|
33
|
-
|
33
|
+
const inputInterest = interest.value;
|
34
|
-
|
34
|
+
presentValue.innerHTML = Math.floor(inputCost/((++inputInterest.value)**inputYear)).toLocaleString();
|
35
35
|
})
|
36
36
|
});
|
37
37
|
```
|