Skip to content
Related Articles

Related Articles

Improve Article
Save Article
Like Article

HTML | DOM requestFullscreen() Method

  • Last Updated : 30 Nov, 2019

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.


Attention reader! Don’t stop learning now. Get hold of all the important HTML concepts with the Web Design for Beginners | HTML  course.


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
Recommended Articles
Page :

Start Your Coding Journey Now!