title: How can I start fullscreen in safari using javascript?
body: <p>I am using this code to start and stop fullscreen:</p>
  
  <pre><code>function fullscreen() {
      full = document.getElementById("full");
      if (!document.fullscreenElement &amp;&amp; !document.mozFullScreen &amp;&amp; !document.webkitIsFullScreen &amp;&amp; !document.msFullscreenElement) {
          elem = document.getElementById("body");
          if (elem.requestFullscreen) {
              elem.requestFullscreen();
          } else if (elem.mozRequestFullScreen) {
              elem.mozRequestFullScreen();
          } else if (elem.webkitRequestFullscreen) {
              elem.webkitRequestFullscreen();
          } else if (elem.msRequestFullscreen) {
              elem.msRequestFullscreen();
          }
      } else {
          if (document.exitFullscreen) {
              document.exitFullscreen();
          } else if (document.mozCancelFullScreen) {
              document.mozCancelFullScreen();
          } else if (document.webkitExitFullscreen) {
              document.webkitExitFullscreen();
          } else if (document.msExitFullscreen) {
              document.msExitFullscreen();
          }
      }
  }
  </code></pre>
  
  <p>It works in every browser but Safari. I read that <code>elem.webkitRequestFullscreen();</code> is for Safari. So how get I this to work in Safari? Whole Website: <a href="https://jnnx.de/sia.html" rel="nofollow noreferrer">jnnx.de/sia.html</a></p>