JS/JS 수업분

[JS] day13_BOM (window.innerHeight/window.innerWidth)

congs 2023. 4. 20. 23:53

 

 

 

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>BOM</title>
</head>
<body>
    <ul>
        <li id="ih">
            window.innerHeight : 툴바를 제외한 높이 >
        </li>
        <li id="iw">
            window.innerWidth : 스크롤바를 포함한 너비  >
        </li>
    </ul>

 

    <script>
        let ih = window.innerHeight;
        let iw = window.innerWidth;
        document.getElementById('ih').innerText += ih;
        document.getElementById('iw').innerText += iw;
    </script>
</body>
</html>