-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
20 lines (14 loc) · 829 Bytes
/
index.js
File metadata and controls
20 lines (14 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
function somamultiplica() {
var homemV = document.getElementById('nhv')
var idadehomemV = document.getElementById('ihv').value
var homemN = document.getElementById('nhn')
var idadehomemN = document.getElementById('ihn').value
var mulherV = document.getElementById('nmv')
var idademulherV = document.getElementById('imv').value
var mulherN = document.getElementById('nmn')
var idademulherN = document.getElementById('imn').value
var somahvmn = parseInt(idadehomemV) + parseInt(idademulherN)
var produtohnmv = idadehomemN*idademulherV
var res = document.getElementById('res')
res.textContent=`A soma das idades entre ${homemV.value} e ${mulherN.value} é ${somahvmn} e O produto das idades entre ${homemN.value} e ${mulherV.value} é ${produtohnmv}`
}