programming-examples/js/Htmldom/Get the width and height of a window online.js
2019-11-15 12:59:38 +01:00

8 lines
309 B
JavaScript

function getSize()
{
var w = document.documentElement.clientWidth;
var h = document.documentElement.clientHeight;
// put the result into a h1 tag
document.getElementById('wh').innerHTML = "<h1>Width: " + w + " • Height: " + h + "</h1>";
}