When concatenating a string with the variables, the operations are not carried out correctly. When the sum is made, when putting the string "Sum", the variables are concatenated, instead if I remove them, they add up fine.
function mates(){
var result = document.getElementById("result");
var num1 = parseInt(prompt("Numero 1"));
var num2 = parseInt(prompt("Numero 2"));
result.innerHTML = "Suma"+num1 + num2+ "<br />";
result.innerHTML += "Resta" +num1 - num2;
}
<html>
<head></head>
<body>
<p>
<input id="bot1" type="button" value="F1" onclick="mates()" />
</p>
<p id="result"></p>
</body>
</html>