title: Next/previous buttons to add in a modal
body: <p>Totally new in this world, but i just love it, and i want to get the best out of it.
  I am making my own photosite and i am stuck here with the next/previous button in modal. What to do?</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-html lang-html prettyprint-override"><code>&lt;img id="myImg" src="myimage" alt="wjuuuu" width="760" height="478"&gt;
  
  
  &lt;!-- The Modal --&gt;
  &lt;div id="myModal" class="modal"&gt;
    &lt;span class="close"&gt;×&lt;/span&gt;
    &lt;img class="modal-content" id="img01"&gt;
    &lt;div id="caption"&gt;&lt;/div&gt;
  &lt;/div&gt;
  
  &lt;script&gt;
  // Get the modal
  var modal = document.getElementById('myModal');
  
  // Get the image and insert it inside the modal - use its "alt" text as a caption
  var img = document.getElementById('myImg');
  var modalImg = document.getElementById("img01");
  var captionText = document.getElementById("caption");
  img.onclick = function(){
      modal.style.display = "block";
      modalImg.src = this.src;
      captionText.innerHTML = this.alt;
  }
  
  // Get the &lt;span&gt; element that closes the modal
  var span = document.getElementsByClassName("close")[0];
  
  // When the user clicks on &lt;span&gt; (x), close the modal
  span.onclick = function() {
      modal.style.display = "none";
  }
  
  &lt;/script&gt;</code></pre>
  </div>
  </div>
  </p>