Defining a for loop in Javascript
<p>I can't seem to define a for loop function, what am I doing wrong?</p>

<p>My HTML code:</p>

<pre><code>&lt;body onload="generate()"&gt;
</code></pre>

<p>My Javascript code:</p>

<pre><code>function generate(){
    for(i = 0; i &lt; 150; i++) {
        document.write("&lt;div&gt;&lt;/div&gt;");
    }
};
</code></pre>
