-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcode.js
More file actions
62 lines (44 loc) · 1.5 KB
/
code.js
File metadata and controls
62 lines (44 loc) · 1.5 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
// inputDeBaixo.addEventListener("input", (dig) => { //não permite tipo texto no input
// let valor = dig.target.value.replace(/\D/g, "")
// dig.target.value = valor
// })
// function numeroTec(num) { //captura número clicado com mouse (onclick no HTML)
// if (ehMenorQueDez()) {
// valorDigitado.value += num // apenas concatena pois value é string
// }
// verificaDigInput()
// }
// document.addEventListener("keydown", (dig) => {//captura número digitado com teclado
// let valor = dig.key
// // console.log(valor);
// if (Number(valor) || (Number(valor) === 0)) {
// // console.log(valor);
// focoBotao(valor)
// if (ehMenorQueDez()) {
// valorDigitado.value += valor// apenas concatena pois value é string
// }
// verificaDigInput()
// }
// // if(['+','-','*','/'].includes(valor))
// if (valor === "+" || valor === "-" || valor === "*" || valor === "/") {
// focoBotao(valor)
// operacao(valor)
// }
// if (valor === "Backspace") {
// focoBotao(valor)
// backspace()
// }
// if (valor === "Escape") {
// focoBotao(valor)
// resetEsc()
// }
// if (valor === 'Enter') {
// focoBotao(valor)
// }
// });
// function verificaDigInput() {
// valorDigitado.value = Number(valorDigitado.value)
// }
// function capturarNumInput() {//captura o valor total do input e converte
// return Number(valorDigitado.value)
// }