I would like to do a check in my code, an "if else", that when I do not put anything to calculate and click the button, it gives an alert warning that it has nothing in the value fields.
I did not get the logic very well, could anyone 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);
}