08.10.2026 - changes Calc with isNan and title in Portfolio

This commit is contained in:
2026-10-08 20:16:55 +02:00
parent 29a0008b70
commit 553cf38eea
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -9,6 +9,12 @@ function calculate(){
let operator = document.getElementById("calcOperator").value;
let result = 0;
if(isNaN(numberOne) === true || isNaN(numberTwo) === true)
{
document.getElementById("calcResult").textContent = "Bitte zwei Zahlen eingeben.";
return;
}
if(operator === "+")
{
result = numberOne + numberTwo;