I have a submit button with a span inside:
<div class="btn-toolbar justify-content-center">
<button type="submit" class="btn btn-primary btn-loading">
<span class="circle"></span> Próxima etapa
</button>
</div>
and I wanted to change the text of it when sending, but when I use .val
nothing happens. But if I use .text
it changes the text but takes out <span>
and it needs to continue.
My JS (already in document ready):
var btnsubmit = $(":submit");
var loadingcircle = $("span.circle");
loadingcircle.show();
btnsubmit.prop('disabled', true).val("Validando CNPJ");