JSFiddle - React, Tailwind, and code Playground
HTML
<div class="ui-btn ui-input-btn ui-corner-all ui-shadow">
<label>clickme</label>
<input class="submit button-primary btn large send" id="wp-submit" name="up_submit" tabindex="250" type="button" value="clickme" />
</div>
JavaScript
$(document).ready(function () {
var clicked = false;
$('#wp-submit').bind('click', function() {
if(clicked == false) {
// store reference to the button clicked
// this allows us to access it within the
// setTimeout callback below.
var $btn = $(this);
$btn.attr('disabled', true);
$btn.siblings('label').text('Please wait...'); // replaces text in label only
$btn.val('Please wait...') // this sets the text on the button itself
clicked = true;
setTimeout(function() {
$btn.attr('disabled', false);
$btn.siblings('label').text('click me');
$btn.val('click me');
clicked = false;
}, 2000);
}
});
});