title: How do I insert HTML tags inside a Javascript array that contains pictures?
body: <p>I've been trying to make a simple array slideshow with pictures and text and I'm super bad at JavaScript. At the moment I have this piece of code which is a slideshow with pictures (without the text):</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>var image = document.getElementById("mainImage");
  var imageArray = ["Items/Images/SkinnyCannibals.png", "Items/Images/PaintedCannibals.png", "Items/Images/Firemen.png", "Items/Images/DynamiteCannibal.png", "Items/Images/Armsy.png", "Items/Images/BabyMutant.png", "Items/Images/Virginia.png", "Items/Images/Cowman.png", "Items/Images/BlueArmsy.png", "Items/Images/BlueVirginia.png", "Items/Images/Worm.png", "Items/Images/EndBoss.png"];
  var imageIndex = 1;
  
  function changeImageNext() {
  
    image.setAttribute("src", imageArray[imageIndex]);
    imageIndex++;
  
    if (imageIndex &gt; imageArray.length) {
      imageIndex = 0;
    }
  
  }
  
  function changeImagePrev() {
  
    image.setAttribute("src", imageArray[imageIndex]);
    imageIndex--;
  
    if (imageIndex &gt; imageArray.length) {
      imageIndex = 0;
    }
  
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;input type="button" value="Next" id="nextButton" onclick="changeImageNext();"&gt;
  &lt;input type="button" value="Prev" id="prevButton" onclick="changeImagePrev();"&gt;
  &lt;img src="Items/Images/SkinnyCannibals.png" id="mainImage"&gt;</code></pre>
  </div>
  </div>
  </p>
  
  <p>Now, what I'd like to have is this array of images and a description of each one of these pictures/monsters (so basically, <em>I think</em>, another array linked to the same buttons). So when you'd press on the Next / Prev buttons you'd get some text for each one of these pictures.</p>
  
  <p>Any ideas on how to solve this? Or maybe other ways to do this with pure Javascript?</p>