on-internet
← Community

How to stop onclick action in JavaScript?

Stack Overflow ·

When the button is clicked, I want the spiners to appear for 3 seconds and then disappear. I can make it visible but I can't make it invisible again. function stoploading() { document.getElementById('loading').style.visibility = 'visible'; } <button class="btn btn-danger d-inline-flex align-items-center" type="button">ATTACK</button> <div class="col text-white m-5 px-5"> <div id="loading" class="spinner-border text-primary load_icon" role="status"> <span class="visually-hidden">Loading...</span> </div> </div> <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bo

Comments

Sign in or sign up to comment and upvote.

No comments yet.