title: IOS10 fullscreen safari Javascript
body: <p>I'm trying to make a div go fullscreen, when a user clicks a button on a website.</p>
  
  <p>Only thing is, every browser seems to want to work except for Safari on IOS.</p>
  
  <p>What will I need to do to be able to make it fullscreen? I've tried researching, but unable to find anything.</p>
  
  <p>Heres my current code:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
  function goFullscreen(id) {
      var element = document.getElementById(id); 
  
      var isInFullScreen = (document.fullscreenElement &amp;&amp; document.fullscreenElement !== null) ||
          (document.webkitFullscreenElement &amp;&amp; document.webkitFullscreenElement !== null) ||
          (document.mozFullScreenElement &amp;&amp; document.mozFullScreenElement !== null) ||
          (document.msFullscreenElement &amp;&amp; document.msFullscreenElement !== null);
  
      var docElm = document.documentElement;
      if (!isInFullScreen) {
          if (element.requestFullscreen) {
              element.requestFullscreen();
          } else if (element.mozRequestFullScreen) {
              element.mozRequestFullScreen();
          } else if (element.webkitRequestFullScreen) {
             element.webkitRequestFullScreen();
          } else if (element.msRequestFullscreen) {
              element.msRequestFullscreen();
          }
      } else {
          if (document.exitFullscreen) {
              document.exitFullscreen();
          } else if (document.webkitExitFullscreen) {
              document.webkitExitFullscreen();
          } else if (document.mozCancelFullScreen) {
              document.mozCancelFullScreen();
          } else if (document.msExitFullscreen) {
              document.msExitFullscreen();
          }
      }
  }
  &lt;/script&gt;
  </code></pre>