Dot dotdot dotdotdot as loading?
问题 I wanna create some loading dots, like this: At 0000 miliseconds the span content is: . At 0100 miliseconds the span content is: .. At 0200 miliseconds the span content is: ... In a loop. What is the best / easiest way to make it? 回答1: <span id="wait">.</span> <script> var dots = window.setInterval( function() { var wait = document.getElementById("wait"); if ( wait.innerHTML.length > 3 ) wait.innerHTML = ""; else wait.innerHTML += "."; }, 100); </script> Or you can get fancy and have them go