Why is the jQuery.attr() method not working inside my 'click' event?
<p>I have the following prototype code to trigger a process when a button is clicked:</p>

<pre><code>jQuery("#queue-process").click(function() {
    jQuery("#queue-process").attr("disabled", "disabled");
    try {
        processQueue();
    } catch (e) {
        console.log(e.message);
    } finally {
        jQuery("#queue-process").removeAttr("disabled");
    }
});
</code></pre>

<p>The <code>processQueue</code> function is always called, but the <code>attr("disabled", "disabled")</code> is called only when I debug the anonymous function in the Chrome JavaScript console, i.e. if I place a breakpoint on that line, and single-step over it, it works, but outside of the debugger only <code>processQueue()</code> executes.</p>

<p>Why could this be happening?</p>
