display images array onclick button
<p>HTML: I set the button onclick "myFunction" Now I would like images to be displayed onclick</p>

<pre><code>&lt;body&gt;



&lt;p&gt;Click the button to see some images&lt;/p&gt;


&lt;button onclick="myFunction()"&gt;See the Images!!!&lt;/button&gt;



&lt;script src="js2/images.js"&gt;





&lt;/script&gt;

&lt;/body&gt;
</code></pre>

<p>JS: Need to display images onclick...Not sure if i am on the right track as I am a beginner at JS...I cant seem to get the images to display, only the src name of the images....</p>

<pre><code>function myFunction() {

pge = new Array ()

 pge[4] = "../images/sky3.jpg"


 pge[3] = "../images/sky8.jpg"

 pge[2] = "../images/sky7.jpg"

 pge[5] = "../images/sky6.jpg"

 pge[0] = "../images/sky5.jpg"

 pge[1]= "../images/sky4.jpg"

 pge[6] = "../images/sky1.jpg"  

 pge[7] = "../images/sky2.jpg"




 for (i=0;i&lt;=pge.length-1;i++) {


var img = document.createElement("img");
</code></pre>

<p>????????</p>

<pre><code>}


}
</code></pre>