-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdivisao.html
More file actions
28 lines (25 loc) · 780 Bytes
/
divisao.html
File metadata and controls
28 lines (25 loc) · 780 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
25
26
27
28
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>divisao</title>
</head>
<body>
<input type="number" name="dxtn1" id="dxtn1"> -
<input type="number" name="dxtn2" id="dxtn2">
<input type="button" value="dividir" onclick="dividir()">
<div id="res">resultado aqui</div>
<script>
function dividir(){
var d1= document.getElementById('dxtn1')
var d2= document.getElementById('dxtn2')
var res=document.getElementById('res')
var n1 = Number(d1.value)
var n2 = Number(d2.value)
var div=n1/n2
res.innerHTML=`a divisao entre ${n1} e ${n2} é igual a ${div}`
}
</script>
</body>
</html>