How to pause javascript code excution for 2 seconds
<p>I want to stop execution for 2 seconds. So is this, but now follows a code block:
    
    
     HW 10.12 
    </p>

<pre><code>for (var i = 1; i &lt;=5; i++)
{
document.write(i);
sleep(2);//for the first time loop is excute and sleep for 2 seconds        
};

&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>

<p>For the first time loop is excute and sleep for 2 seconds. I want to stop execution for two seconds?</p>
