Use jQuery to change text on a link on first press, then go to link on second press
<p>I'm trying to use jQuery to make a "Are you sure?" function on a delete link.
My current code:</p>

<pre><code>$('.confirm-delete').on('click', function(e) {
e.preventDefault();
$(this).removeClass("confirm-delete");
$(this).html("&lt;i class='icon-remove icon-white'&gt;&lt;/i&gt; Are you sure?");
$(this).attr("href", "?delete="+this.id.replace('id', ''));
});
</code></pre>

<p>I have given the link the class "confirm-delete" and it changes both the text and the url fine, but it will not let me press a second time. Nothing happens. I suspect it's because of the preventDefault, that's why I try to remove the class, but to no effect.
I hope someone can help me out with this. Thank you.</p>
