title: How Do I Make The Modal Open?
body: <p>I am currently attempting to open a modal for these images. When I click them, nothing happens. My best guess is that it has something to do with the openModal function on the first two lines of the JS file, I think I need to change where it gets the document, but I am not too sure.</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>function openModal(){
      document.getElementById("myModal").style.display = "block";
  }
  function closeModal(){
      document.getElementById("myModal").style.display = "none";
  }
  
  var slideIndex = 1;
  showSlides(slideIndex);
  
  function plusSlides(n) {
      showSlides(slideIndex += n);
  }
  
  function plusSlides(n) {
      showSlides(slideIndex = n);
  }
  
  function currentSlides(n) {
      showSlides(slideIndex = n);
  }
  
  function showSlides(n) {
      var i;
      var slides = document.getElementsByClassName("mySlides");
      var dots = document.getElementsByClassName("demo");
      if (n &gt; slides.length) {slideIndex = 1}
      if (n &lt; 1) {slideIndex = slides.length}
      for ( i = 0; i &lt; slides.length; i++) {
          slides[i].style.display = "none";
      }
      for (i = 0; i &lt; slides.length; i++) {
          dots[i].className = dots[i].className.replace(" active ", "");
      }
      slides[slideIndex-1].style.display = "block";
      dots[slideIndex-1].className += " active";
  }</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;!--Gallery--&gt;
    &lt;section id="gallery"&gt;
      &lt;div class="container"&gt;
          &lt;h1&gt;Gallery&lt;/h1&gt;
          &lt;div class="flex-container"&gt;
              &lt;!--photo container--&gt;
              &lt;div class="photo-container"&gt;
                  &lt;div class="photo"&gt;
                      &lt;img src="images/thumbnail_1.jpg" onclick="openModal();currentSlide(1)" alt=""&gt;
                      &lt;div class="photo-overlay"&gt;
                          &lt;h3&gt;Click to Enlarge&lt;/h3&gt;
                          &lt;p&gt;We have several books fr you&lt;/p&gt;
                      &lt;/div&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
             &lt;/div&gt;
             
             &lt;div id="myModal" class="modal"&gt;
      &lt;span class="close cursor" onclick="closeModal()"&gt;&amp;times;&lt;/span&gt;
      &lt;div class="modal-content"&gt;&lt;/div&gt;
  
          &lt;div class="mySlides"&gt;
              &lt;div class="numberText"&gt;1 / 9&lt;/div&gt;
              &lt;img src="images/thumbnail_1.jpg" style="width: 100%;" alt="image 1"&gt;
          &lt;/div&gt;
           &lt;!--Thumbnail Image Controls--&gt;
          &lt;div class="column"&gt;
              &lt;img class="demo" src="images/thumbnail_1.jpg" onclick="currentSlide(1)" alt="image"&gt;
          &lt;/div&gt;
             </code></pre>
  </div>
  </div>
  </p>