How to get the current window (screen) inner width and inner height on resize in JavaScript

1 Answer

0 votes
<p id="screen_size"></p>
<script type="text/JavaScript">   

window.onresize = function(event) {
    document.getElementById("screen_size").innerHTML = "Width: " + window.innerWidth 
                                           + "<br / >Height: " + window.innerHeight;
};

</script>

 



answered May 25, 2016 by avibootz

Related questions

...