1
I would like to check my code, an "if Else", that when I do not put anything to calculate and click the button, it gives an alert warning that there is nothing in the value fields.
I didn’t quite grasp the logic, someone could help me?
document.getElementById("btn-calcular").onclick = function(){
var valorA = document.getElementById("valor-a").value;
var valorB = document.getElementById("valor-b").value;
alert(parseInt(valorA) + parseInt(valorB));
document.getElementById("resposta").value = parseInt(valorA) + parseInt(valorB);
}
Man, that’s what it was. Thank you for real! Hug
– Leonardo M
Thanks ;) Be strong there, practice a lot!
– Luís Almeida