title: plain javascript, onclick not working on mobile
body: <p>Now I am not a star really with Javascript, but i seem to encounter the all known problem with mobile devices and the onclick function. Onclick requires a mouse action where off course on the phone that doesnt apply. Now in Jquery, you can use "on" .. but how does this work with regular javascript?</p>
  
  <pre><code>// Get the modal
  var modal = document.getElementById('reserveer-modal');
  
  // Get the button that opens the modal
  var btn = document.getElementById("reserveer-knop");
  
  // Get the &lt;span&gt; element that closes the modal
  var span = document.getElementsByClassName("close")[0];
  
  // When the user clicks the button, open the modal 
  btn.onclick = function() {
      var x = window.innerWidth;
      if (x &gt; 768) {
  
          //event.preventDefault();
          modal.style.display = "block";
      } else {
          //event.preventDefault();
      }
  }
  
  // When the user clicks on &lt;span&gt; (x), close the modal
  span.onclick = function() {
      modal.style.display = "none";
  }
  
  // When the user clicks anywhere outside of the modal, close it
  window.onclick = function(event) {
      if (event.target == modal) {
          modal.style.display = "none";
      }
  }
  </code></pre>