title: Animate CC HTML5 - toggle fullscreen
body: <p>I have this code (below) on a buton to force my HTML5 game to fullscreen, but I'd like to have it turn back also with the button - right now it only works using ESC key. Is it possbile?</p>
  
  <pre><code>this.fsbtn.addEventListener("click", doFullscreen);
  
  function doFullscreen() {
      var i;
      var elem = document.getElementById("animation_container");
      var fs = ["requestFullscreen", "webkitRequestFullscreen", "mozRequestFullScreen", "msRequestFullscreen"];
  
      for (i = 0; i &lt; 4; i++) {
          if (elem[fs[i]]) {
              elem[fs[i]]();
              break;
          }
      }
  }
  </code></pre>