fire css change before end of code
<p>I'm sure this question has already been asked, but I can't found the good keyword to feed google with. I can't even find a good title for my question.
I want to do this :</p>

<pre><code>$(".selector").click(function() {
    $(this).css("background-color", "red");
    if (confirm("Do you want to do this ?") {
        // do this
    } else {
        $(this).css("background-color", "transparent");
    }
});
</code></pre>

<p>But the css change is fired only after I confirm. How can I fire it before the confirm (or during the confirm) ?</p>

<p>Thanks.</p>
