title: Putting images in a simple parallel array with next previous buttons
body: <p>I’m really new to JavaScript and trying to figure out a basic slide with pictures built in an array. Like you click next and previous to get new images.</p>
  
  <p>How can I do that? Here is what I have so far. </p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  
  &lt;script&gt;
  
  imgArray = new Array(
  “image”,
  “image”
  “image”); 
  
  x=1
  y=2; 
  
  function move{
  y = y+xflip; 
  if (y&gt;x)
  {y = 1;}
  if (y==0)
  {y = x; 
  document.images[2].src = img[y-1];}
  
  &lt;/script&gt;
  
  &lt;input type=“button” value=“Prev” name=“buttonp” onclick=“slide(-1)”&gt;
  &lt;input type=“button” value=“Next” name=buttonb” onclock=“slide(1)”&gt;
  
  &lt;img src=“image1”&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Please help. Thanks.</p>