$(function() { $('a.confirmation').click(function(event){ if (confirm("Are you sure?")!=true){ event.preventDefault(); } }) })