JavaScript Loading Spin

This script has less than 1 Kbyte

The jSuites.loading is a lightweight JavaScript loading spin control. The example below will show the loading spin for 2 seconds.

<script src=""></script>
<link rel="stylesheet" href="" type="text/css" />

<input type='button' value='Show the loading' class='jbutton dark' id='showbtn'>
<i>The loading will stop after two seconds</i>

const show = function() {
    // Show the loading spin;
    // Hide the loading spin after two seconds
    setTimeout(function() {
        // Hide
    }, 2000);
showbtn.onclick = () => show()