When dividing by zero, the result is "Infinity". How to make it so that instead of Infinity, it was written in the window "You cannot divide zero!", Or did the alert pop up with this message? Here is the calculator code:
<input type="button" value=" ÷ " onclick="calculator.answer.value += '/';checkLength(this);checkDivToZero(this);" /> function checkDivToZero(input) //функція ділення { var value = input.value; if (input.value =='Infinity') { alert("Divide by zero error"); } }