title: How to change onclick become onload?
body: <p>I want to make the page fullscreen automatically without the need to click anything. I've tried to change this 
  <code>&lt;body onclick="toggleFullScreen()"&gt;</code> into <code>&lt;body onload="toggleFullScreen()"&gt;</code>. but nothing happens; it doesn't work. :(</p>
  
  <p>This is the javascript..</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function errorHandler() {
     alert('mozfullscreenerror');
  }
  document.documentElement.addEventListener('mozfullscreenerror', errorHandler, false);
  
  // toggle full screen
  
  function toggleFullScreen() {
    if (!document.fullscreenElement &amp;&amp;    // alternative standard method
        !document.mozFullScreenElement &amp;&amp; !document.webkitFullscreenElement) {  // current working methods
      if (document.documentElement.requestFullscreen) {
        document.documentElement.requestFullscreen();
      } else if (document.documentElement.mozRequestFullScreen) {
        document.documentElement.mozRequestFullScreen();
      } else if (document.documentElement.webkitRequestFullscreen) {
        document.documentElement.webkitRequestFullscreen(Element.ALLOW_KEYBOARD_INPUT);
      }
    } else {
      if (document.cancelFullScreen) {
        document.cancelFullScreen();
      } else if (document.mozCancelFullScreen) {
        document.mozCancelFullScreen();
      } else if (document.webkitCancelFullScreen) {
        document.webkitCancelFullScreen();
      }
    }
  }</code></pre>
  </div>
  </div>
  </p>