 <p>You may have to use a callback here</p> <pre><code>var list = document.getElementById('SomeList'); var items = list.getElementsByTagName('li'); var i = 0; var myFunction1 = function() { if ( i &lt; items.length ) { // Do some code with items[i] i++; setTimeout(myFunction1, 1500); } else { // No more elements return; } } </code></pre> <p>This way your <code>myFunction1</code> will execute every 1.5 seconds.</p>