<html>
    <head> 
        <meta charset="utf-8" /> 
        <title>test</title> 
    </head> 
    <body style="background-color: red;width: 100vw;height: 100vh" id="123">  
        <script>
            window.onresize = function() {
                var res = document.getElementsByTagName('html')[0].getBoundingClientRect();
                document.getElementById("123").innerHTML=JSON.stringify(res)
            }
        </script> 
    </body>
</html>
As in the above code, the width and height values corresponding to the window zoom will also change. The actual width and height cannot be obtained when there is a scroll bar. What I want to obtain is the current visible area plus the area hidden by the scroll bar, no matter how the window changes, the width and height Should be immobile


 
     
     
     
     
    