Created
March 12, 2010 22:20
-
-
Save cdevroe/330865 to your computer and use it in GitHub Desktop.
jQuery confirm delete?
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(document).ready(function(){ | |
// All links with class delete | |
$('.delete').click(function(event){ | |
var answer = confirm("Are you sure you want to delete this item?"); | |
if (answer) { | |
// Delete item. | |
} else { | |
event.preventDefault(); // Do not delete item. | |
} | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment