-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathallin.html
More file actions
62 lines (55 loc) · 2.21 KB
/
allin.html
File metadata and controls
62 lines (55 loc) · 2.21 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
</head>
<body>
<input id="result" type="text">
<br>
<input value="1" id="one" onclick="clickMotherFucker(1)" type="button">
<input value="2" id="two" onclick="clickMotherFucker(2)" type="button">
<input value="3" id="three" onclick="clickMotherFucker(3)" type="button">
<input value="4" id="four" onclick="clickMotherFucker(4)" type="button">
<br>
<input value="5" id="five" onclick="clickMotherFucker(5)" type="button">
<input value="6" id="six" onclick="clickMotherFucker(6)" type="button">
<input value="7" id="seven" onclick="clickMotherFucker(7)" type="button">
<input value="8" id="eight" onclick="clickMotherFucker(8)" type="button">
<br>
<input value="9" id="nine" onclick="clickMotherFucker(9)" type="button">
<input value="+" onclick="clickMother('+')" type="button">
<input value="-" onclick="clickMother('-')" type="button">
<input value="*" onclick="clickMother('*')" type="button">
<br>
<input value="/" onclick="clickMother('/')" type="button">
<input value="=" onclick="clickRes()" type="button">
<!-- <input value="Нажми меня" onclick="clickMotherFucker()" type="button"> -->
<script>
var action;
var first;
var second;
// document.getElementById("one").value = "AZAZAZ"
function clickMotherFucker(number) {
document.getElementById("result").value += number
}
function clickMother(action) {
this.first = document.getElementById("result").value
this.action = action
document.getElementById("result").value = ''
}
function clickRes() {
this.second = document.getElementById("result").value
if(this.action === "+")
document.getElementById("result").value = Number.parseInt(this.first) + Number.parseInt(this.second)
if(this.action === "-")
document.getElementById("result").value = Number.parseInt(this.first) - Number.parseInt(this.second)
if(this.action === "/")
document.getElementById("result").value = Number.parseInt(this.first) / Number.parseInt(this.second)
if(this.action === "*")
document.getElementById("result").value = Number.parseInt(this.first) * Number.parseInt(this.second)
}
console.log(result)
</script>
</body>
</html>