Home >Web Front-end >JS Tutorial >Bootstrap changes button loading status_javascript skills
When there is an activation button in bootstrap, the button becomes unavailable;
According to the method introduced on the official website, add a data-loading-text="Loading..." attribute to the button button, and then the overall js code is as follows:
<script><br>
$('#myButton').on('click', function () {<br>
var $btn = $(this).button('loading')<br>
// business logic...<br>
$btn.button('reset')<br>
})<br>
</script>
The autocomplete="off" attribute is used so that the disabled state will not be automatically lifted after the FF browser loads the page.
When I used the above code directly, I found that there was no loading status.
Then I changed it myself and wrote it like this, and it was OK
With just a few changes, we can achieve our requirements. I don’t know if the official version was put up without testing. Here I recommend the solution to my friends.