Skip to content
Related Articles
Open in App
Not now

Related Articles

HTML | DOM requestFullscreen() Method

Improve Article
Save Article
  • Last Updated : 30 Nov, 2019
Improve Article
Save Article

The requestFullscreen() method opens the element in a full-screen mode. If the element is in full-screen mode, then nothing gets changed. The reverse of this method is exitFullscreen() method.



Parameters: It does not accept any parameters.

Return Value: It does not return any value.


<!DOCTYPE html> 
        HTML DOM requestFullscreen() Method
        var elem = document.documentElement; 
        function closeFullS() { 
            if (document.exitFullscreen) 
        function openFullS() { 
            if (elem.requestFullscreen) 
<body style="text-align:center;"
    <h1 style="color:green">
        HTML DOM requestFullscreen() Method
    <button onclick="openFullS();"
        Open Fullscreen 
    <button onclick="closeFullS();"
        Close Fullscreen 


Supported Browsers: The browser supported by requestFullscreen() Method are listed below:

  • Chrome
  • Firefox
  • Internet Explorer
  • Opera
  • Safari

My Personal Notes arrow_drop_up
Related Articles

Start Your Coding Journey Now!