Button of the js plug-in of Bootstrap)
1) attributes:
Data-loading-text = loading... -- display the button loading status;
Data-toggle = button -- enables the button to switch status;
Data-toggle = buttons -- enables the button group to have the select/cancel function similar to the selection box;
Autocomplete = off -- solve the FireFox compatibility problem: FireFox keeps the button disabled between multiple page loads;
2) method:
$ (). Button (toggle) -- switch button status;
$ (). Button (loading) -- set the button status to loading-set the button to disabled and switch the text content to loading;
$ (). Button (reset) -- reset button status-and restore the text on the button to the original value;
$ (). Button (string) -- reset button status-and reset the text on the button to the input value.
For more details, see examples:
<Script src = js/jquery-2.1.3.min.js> </script> <script src = js/bootstrap. min. js> </script> Button. js example Submit comments Comment Sales priority Price first Distance priority Sichuan food Hunan food Cantonese cuisine Make sure you are 18 years old!<Script> // click the button to change the text to loading ..., restore in 3 seconds $ (. js-loading-btn ). on (click, function () {var btn = $ (this ). button (loading); setTimeout (function (e) {btn. button (reset)}, 3000) ;}; $ (. mybtn ). on (click, function (e) {$ (this ). button ('complete'); $ (this ). removeClass ('btn-warning'); $ (this ). addClass ('btn-primary ') ;}); </script>