When you use jQuery and bootstrap, you can follow this example at http://jsfiddle.net/liuyl/RdpRw/1/
$('button[data-loading-text]')
.on('click', function () {
var btn = $(this)
btn.button('loading')
setTimeout(function () {
btn.button('reset')
}, 3000)
});
OBS: see full sample link. Pay attention to external libraries in the left menu on jsfiddle, you cannot forget to link to them.
source
share