Enable a disabled button and click it with Javascript
<p>I have a disabled button I want to click with Javascript.
The following function works in Chrome but not in Firefox.<br>
The problem with Firefox: Firefox javascript is too slow.<br>
The button is still disabled if the code wants to click it. How to click the button when it is enabled?</p>

<pre><code>function enable_and_click() {
    document.getElementById('button1').disabled=false;
    document.getElementById('button1').click();
}
</code></pre>
