How to Make a Loader

loader code I used... I made it :)

var t = true; var i = 0; var j = 0; var b = ['   ', '.  ', '.. ', '...']; var l = ['/', ' -', '\\', '|']; setInterval(function() { if (t) { i++; i %= 4; document.getElementById('l1').innerHTML = l[i]; document.getElementById('l2').innerHTML = l[i]; } }, 100) setInterval(function() { if (t) { j++; j %= 4; document.getElementById('dots').innerHTML = b[j]; } }, 300) setInterval(function() { if (t) { val += 3; val %= 100; document.getElementById('val').value = val.toString(); } }, 200)

loading