Enabling full screen in Javascript.
1 min readJul 20, 2019
Learn how to enable full screen using Javascript.
We can use requestFullscreen()
method on any element to make the element as full screen. requestFullscreen()
method makes an asynchronous request to make the element be displayed in full-screen mode.
We can check if any other element is already in fullscreen mode by using document.fullscreenElement
.
To exit fullscreen we can use document.exitFullscreen()
The above code will make the document to go full screen. To make a video as fullscreen
If you find this helpful surprise ๐ me here.
Share if you feel happy ๐ ๐ ๐ .
Follow Javascript Jeep๐ if you feel worthy.