<!DOCTYPE html>
<html lang="id">
<head>
    <meta charset="utf-8">
    <title>JavaScript Event Resize</title>
</head>
<body>
    <p id="hasil"></p>
    <script>
        function displayWindowSize(){
            var w = window.outerWidth;
            var h = window.outerHeight;
            var txt = "Window size: width=" + w + ", height=" + h;
            document.getElementById("hasil").innerHTML = txt;
        }
        window.onresize = displayWindowSize;
    </script>
    <p><strong>Catatan:</strong> Ubah ukuran jendela browser untuk melihat cara kerja acara pengubahan ukuran.</p>
</body>
</html>

External CSS

This Pen doesn't use any external CSS resources.

External JavaScript

This Pen doesn't use any external JavaScript resources.