Disable button for specified time

Maybe needed on handling ajax calls...

by shapeshifta

HTML

<button id="someButton">test</button>

<div id="output">HTML-Dummy</div>

JavaScript

var someButton = $('#someButton'),
    output = $('#output');

someButton.click(function(e) {
    e.preventDefault();
    output.html('clicked');
    $(this).attr('disabled', 'disabled');
    setTimeout(function() {
        someButton.removeAttr('disabled');
        output.html('reset');
    }, 5000);
});