-
Notifications
You must be signed in to change notification settings - Fork 191
Expand file tree
/
Copy pathSumNumber.js
More file actions
24 lines (23 loc) · 742 Bytes
/
SumNumber.js
File metadata and controls
24 lines (23 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
var total = 0;
function depositar() {
total += parseInt(document.getElementById("txt").value);
document.getElementById("dep").innerHTML = "--valor depositado--";
}
function verConta() {
document.getElementById("ex").innerHTML = total;
document.getElementById("dep").innerHTML = "";
}
<!DOCTYPE html>
<head>
<title>banco</title>
</head>
<body>
<h1 style="float: left;">No Caixa:</h1><h1 id="ex" style="float: left;">0</h1>
</br></br></br></br></br>
<input id="txt" type="number">
<button onclick="depositar()">Depositar</button>
<button onclick="verConta()">ver Conta</button>
<p id="dep"></p>
</body>
</html>
//https://pt.stackoverflow.com/q/273586/101