08.10.2026 - changes Calc with isNan and title in Portfolio
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user