I have a link that I would like to submit with confirmation. I am using the javascript confirm() method. But the only way to make the link not work when the user clicks cancel is to use return false; . Is this the right way to do this (cross browser)?
$('a.confirm').click(function() { if(confirm('Are you sure? This cannot be undone.')) { return true; } return false; });
javascript jquery
Andrew
source share