Scot Ranney • February 20, 2026
This is a slick little jquery bit that gives you a browser popup to confirm your click. Used on modules or in templates.
Includes a way to customize the message.
HTML
First, here's a basic link with a simple default "are you sure?" confirmation message:
<a class="confirmclick" href="something.html">Delete Everything!</a>
This will bring up "Are you sure?"
This link has a custom popup message:
<a class="confirmclick" data-msg="The frogs will be unhappy." href="something.html">Delete all lilly pads</a>
JQUERY
The jquery to handle this is short and simple. It either takes the message you put in data-msg or it defaults to "Are you sure?"
data-msg
<script> $('.confirmclick').on('click', function () { var $el = $(this); var msg = $el.data('msg'); if(!msg){ msg = 'Are you sure?' } return confirm(msg); }); </script>
mvkb_jquery