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

1 Answer

0 votes
<button onclick="W_H_Function()">Get Current Width and Height</button>

<p id="scree_size"></p>
<script type="text/JavaScript">   

function W_H_Function() {
    document.getElementById("scree_size").innerHTML = "Width: " +  window.innerWidth 
                                          + "<br / >Height: " + window.innerHeight;
}
</script>

 



answered May 25, 2016 by avibootz
...