SyntaxFix
Write A Post
Hire A Developer
Questions
The alert method blocks execution until the user closes it:
use the confirm function:
if (confirm('Some message')) { alert('Thanks for confirming'); } else { alert('Why did you press cancel? You should have confirmed'); }