Skip to content

Instantly share code, notes, and snippets.

@kyleslattery
Forked from cdevroe/jQuery Confirm delete?
Created March 13, 2010 05:42
Show Gist options
  • Save kyleslattery/331138 to your computer and use it in GitHub Desktop.
Save kyleslattery/331138 to your computer and use it in GitHub Desktop.
$(document).ready(function(){
// All links with class delete
$('.delete').click(function(event){
// This should work--if cancel is pressed, it returns false, canceling
// the click. I haven't tested it out myself, though.
return confirm("Are you sure you want to delete this item?");
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment