-
Notifications
You must be signed in to change notification settings - Fork 0
/
script.js
26 lines (20 loc) · 922 Bytes
/
script.js
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
let input = document.getElementById("input");
let increase = document.getElementById("increase");
let decrease = document.getElementById("decrease");
let clear = document.getElementById("clear");
// --------------------------------------------------------------------------------------------------
increase.addEventListener("click", () => {
let inputvalue = parseInt(input.value);
let newinputvalue = inputvalue + 1;
input.value = newinputvalue;
})
// --------------------------------------------------------------------------------------------------
decrease.addEventListener("click", () => {
let inputvalue = parseInt(input.value);
let newinputvalue = inputvalue - 1;
input.value = newinputvalue;
})
// --------------------------------------------------------------------------------------------------
clear.addEventListener("click", () => {
input.value = 0;
})