-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCalculadora.html
59 lines (55 loc) · 2.13 KB
/
Calculadora.html
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
<!DOCTYPE html>
<html>
<head>
<script>
function Soma(){
var n1 = parseInt(document.getElementById("iptNum1").value);
var n2 = parseInt(document.getElementById("iptNum2").value);
document.getElementById("iptResul").value =(n1 + n2);
}
function Sub(){
var n1 = parseInt(document.getElementById("iptNum1").value);
var n2 = parseInt(document.getElementById("iptNum2").value);
document.getElementById("iptResul").value =(n1 - n2);
}
function Div(){
var n1 = parseInt(document.getElementById("iptNum1").value);
var n2 = parseInt(document.getElementById("iptNum2").value);
document.getElementById("iptResul").value = (n1 / n2);
}
function Mult(){
var n1 = parseInt(document.getElementById("iptNum1").value);
var n2 = parseInt(document.getElementById("iptNum2").value);
document.getElementById("iptResul").value = (n1 * n2);
}
</script>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css.css">
<script src="javascript.js"></script>
<title></title>
</head>
<body class="backgroundBody">
<div class="bgPrincipal">
<br><h1>ATIVIDADE DE JAVASCRIPT</h1><br>
<a href="Calculadora.html"><button id="btnOpcCalc">Calculadora</button></a>
<a href="Cursos.html"><button id="btnOpcCurso">Cursos</button></a>
<a href="Tabela.html"><button id="btnOpcTable">Tabela</button></a>
<div class="backgroundPanelCalc">
<div id="painel">
<h3>CALCULADORA</h3>
<div class="painelButton">
<button type="button" onclick="Mult()" id="btnCalc">X</button>
<button type="button" onclick="Sub()" id="btnCalc">-</button>
<div class="direita"></div>
<button type="button" onclick="Div()" id="btnCalc">/</button>
<button type="button" onclick="Soma()" id="btnCalc">+</button>
</div>
<input id="iptResul" type="text" name="result" readonly="true" placeholder="RESULTADO"><br>
<input class="iptNum" id="iptNum1" type="text" name="num1" placeholder="número 1">
<input class="iptNum" id="iptNum2" type="text" name="num2" placeholder="número 2">
</div>
</div>
<p id="desenvolvido"> Sistema desenvolvido por Mateus Inocentini - 2018.
</div>
</body>
</html>