Bootstrap Click to disable the button and JS what is the difference between it and how to achieve it, today we will look at a click on the bootstrap to disable the button after the best way, the specific example below.
To prevent multiple submissions from clicking on the button in the bootstrap, you want to disable the button after clicking the button.
The implementation methods are as follows:
Disable button $ (' button '). addclass (' disabled '); Disables visually $ (' button '). Prop (' disabled ', true); Disables visually + functionally//Disable input button for button $ (' Input[type=button] '). addclass (' disabled '); Disables visually $ (' Input[type=button] '). Prop (' disabled ', true); Disables visually + functionally//Disable hyperlink $ (' a '). addclass (' disabled '); Disables visually $ (' a '). Prop (' disabled ', true); Does nothing $ (' a '). attr (' disabled ', ' disabled '); Disables visually writes the above method to the Click event, such as: $ (". Btn-check"). Click (function () {$ (' button '). addclass (' disabled ');//Disable S visually $ (' button '). Prop (' disabled ', true);
Disables visually + functionally});
JS button clicks after a few seconds is not available: function timer (time) {var btn = $ ("#sendButton"); Btn.attr ("Disabled", true); button to stop clicking Btn.val (Time <= 0?)
"Send dynamic Password": ("" + (Time) + "After seconds to send"));
var hander = SetInterval (function () {if (time <= 0) {clearinterval (hander);//Clear Countdown Btn.val ("Send dynamic password");
Btn.attr ("Disabled", false);
return false; }eLSE {Btn.val ("" + (time--) + "seconds to send");
}, 1000); }//Call method Timer (30);
The above is a small set to introduce the Bootstrap button after clicking is disabled the best way to achieve the button, I hope to help you, if you have any questions please give me a message, small series will promptly reply to everyone. Here also thank you very much for the cloud Habitat Community website support!