The "Cancel" Button of an Alert or Prompt


The “cancel” button of an alert or prompt doesn’t seem to work oftentimes…with my buggier-than-normal beginner’s code, I could really use a real working cancel button! :wink:

Just curious if this is a design oversight or something intentional…but if intended, then what’s the point of offering a “cancel” button that doesn’t always actually cancel??


This question was sort of answered in your earlier topic. prompt() returns null when the user cancels. Think on that for a minute then try to come up with some logic that leverages it. alert() does not have a cancel button, only prompt() does.

Switch Statement "Memory?" "Informally" Looping a Switch Statement

You mean at Switch Statement "Memory?" "Informally" Looping a Switch Statement?

Yes, thanks – and thanks for pointing out that alert() does not have a cancel button! It’s all becoming such a blur…you know, I’ve literally been dreaming that I’m coding, arguing about code with somebody??? LOL – strange but true!!! Been happening for the at least the past four nights!!! I wake up feeling all puzzled about code on a blackboard (yes, old-fashioned blackboard)!!!