<html>
<body>
<p>This example uses the HTML DOM to assign an "onresize" event to the body element.</p>
<p>Try to resize the browser window.</p>
<p>Window resized <span id="demo">0</span> times.</p>
<script>
document.getElementsByTagName("BODY")[0].onresize = function() {myFunction()};
var x = 0;
function myFunction() {
var txt = x += 1;
document.getElementById("demo").innerHTML = txt;
}
</script>
</body>
<!-- Mirrored from www.w3schools.com/jsref/tryit.asp?filename=tryjsref_onresize_dom by HTTrack Website Copier/3.x [XR&CO'2014], Mon, 27 Jan 2020 03:02:58 GMT -->
</html>