How to detect an empty value when user presses ok on prompt (and previously empties the prompt field)? I need to overwrite the old value with the new (empty) value. I'm doing this:
var oldVal = 'something';
var newVal = prompt(Enter new value:, oldVal);
Currently it returns null if user empties value and clicks ok.
But at the same time I need to check for null value because if user clicks 'cancel', it will return null, which I don't want as new value.