Toggle Fullscreen Mode Using the JavaScript Fullscreen API

The Fullscreen API allows a web page or an HTML element to be viewed in fullscreen mode, hiding all browser user interface and other applications from the screen. You can use this API to bring videos, images, and other content to a user's full attention. Simply call the requestFullscreen() method…