Meglio mostrare un popup di conferma. Ad es. https://www.w3schools.com/js/tryit.asp?filename=tryjs_confirm