-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmouse.html
More file actions
42 lines (33 loc) · 1.01 KB
/
mouse.html
File metadata and controls
42 lines (33 loc) · 1.01 KB
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>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Mouse task</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="main.js"></script>
</head>
<body>
<input id="valueInput" value="0" onmouseenter="initilize()"><br>
<input id="incB" type="button" value="increment" onmousemove="increment()">
<input id="decB" type="button" value="decrement" onmousemove="decrement()"><br>
</body>
<script>
let numInput = window.document.getElementById("valueInput");
// let data = parseInt(numInput.value)
function increment(){
let data = parseInt(numInput.value);
data++;
numInput.value=data;
}
function decrement(){
let data = parseInt(numInput.value);
data--;
numInput.value=data;
}
function initilize(){
numInput.value=0;
}
</script>
</html>