Fullscreen Mode

Many elements, such as <video>, <canvas>, <div> and <body>, can be switched to its fullscreen mode.

This is done by obtaining the element and then calling requestFullscreen() on it.

Here we call requestFullscreen() on document.documentElement.
In practice, you can call the method on other types of elements obtained by calling, for example, getElementById(...).
document.fullscreenElement points to the element currently in fullscreen mode and is NULL if no element is in fullscreen mode.

Note that you can't switch an element to fullscreen mode as the document is loaded. The switch must be triggered by a user-invoked event such as a mouse click or a pressed key.