Web Lucas
Coming back fresh ...
Calendar 06.05.2021

Let’s look at how to get the height and width of the viewport using Vanilla JS. We can use window.innerHeight to get the viewport height, and window.innerWidth to get viewport width.

let windowWidth   = window.innerWidth;  // get the window width
let windowtHeight = window.innerHeight; // get the window height

Here’s a live demo.

Thanks for your time,
Best regards. Lucas.