It should look like:
$('input.delete').bind('click', function() { if(!confirm('are you sure') ) return false; });
returning false from the event handler, it calls the event.preventDefault and event.stopPropagation .
As for your comment, I would go in such a way as to have different lines for different inputs:
$('input').bind('click', function(e) { var msg; switch(e.className) { case 'foobar': msg = 'Foo foo foo!?'; break; case 'yay': msg = 'yay yay yay!?'; break;
Demo: http://www.jsfiddle.net/ks9Ak/
jAndy source share