SoFunction
Updated on 2025-03-10

How to display full screen of js control page and exit full screen display

<!DOCTYPE html>   
<html>   
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />   
<body>   
<div style="margin:0 auto;height:600px;width:700px;"> 
<button > Full screen display and exit full screen display of js control page</button>
<div style="margin:0 auto;height:500px;width:700px; background:#ccc;" > 
<h1>JS control page full screen display and exit full screen display</h1>
</div> 
</div>   
</body>   
<script language="JavaScript">     
("btn").onclick=function(){    
    var elem = ("content");     
    requestFullScreen(elem);    
};    
function requestFullScreen(element) {   
    var requestMethod = || || || ;   
    if (requestMethod) {     
        (element);   
    } else if (typeof !== "undefined") {     
        var wscript = new ActiveXObject("");   
        if (wscript !== null) {   
            ("{F11}");   
        }   
    }   
}   
</script>   
</html>