Every time I switch from a spinner back to a button, the button's size changes. I am struggling to identify the cause of this issue.
function resizeButton() {
var btn = document.getElementById('submitBtn');
btn.innerHTML =
'<span class="spinner-border spinner-border-sm"></span>';
setTimeout(resetButton, 5000);
}
function resetButton() {
const btn = document.getElementById('submitBtn');
btn.innerHTML =
'<span class="btn btn-primary">Submit</span>';
}
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="e6838e8e959295938091a1d5cfd2cfd0">[email protected]</a>/dist/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<div class="navbar-nav">
<button id='submitBtn' class="btn btn-primary" type="submit" onclick='resizeButton();'>Submit</button>
</div>