-1
Hi, I’m trying to change a button where when it’s clicked. Your content is changed to show a "loading" and after loading the page the button goes back to the previous state. I have tried several ways but without success, I do not know if it is conflict; they could help me by kindness?
The project front end is in JSP, we use bootstrap 4.4.
The code of the button I want to change is:
Research/*Codigo que quero alterar*/
<div class="col-4 text-right">
<button class="btn btn-sm btn-primary" name="Pesquisar" type="submit">Pesquisar</button>
</div>
I tried the way below to pass the data using ID in the DIV, because they have other class "button" in the page I do not want to include the Loading.
HTML:
Loading">SearchJS/JQ:
$('#load'). click(Function() { var btn = $(this) btn.button('loading') setTimeout(Function() { btn.button('reset') }, 9000) });<script type="text/javascript">
/*codigo que tentei*/
$('#load').click(function () {
var btn = $(this)
btn.button('loading')
setTimeout(function () {
btn.button('reset')
}, 9000)
});
</script>
/*codigo que tentei*/
<div class="col-4 text-right">
<button type="submit" class="btn btn-sm
btn-primary" id="load" data-loading-text="<i class='fa fa-spinner
fa-spin'></i> Carregando">Pesquisar</button>
</div>
do not put code images, put the code itself so that we can test (use Jsfiddle) in case
– user152996