To remove my jQuery, I am looking to create a βconfirmβ class for various elements with event handlers so that I can launch a quick confirmation window so that the user can confirm their action.
If the user clicks on cancel in the confirmation window, any subsequent events should be canceled, but this should not be permanent, for example, triggering the event again should cause confirmation and start again. If I can fix this, I can take some delicate action with a confirmation question to make sure the user wants to click.
For instance:
$('.confirm').click(function() {
if(!confirm('Are you sure?')) {
}
});
$('.clicker').click(function() {
alert('it happened');
});
<a class="clicker confirm">Click me</a>
The desired conclusion will be that canceling the confirmation will cancel the click event, but will not completely disable it.