css window width code example
Example 1: how to get the height of window in javascript
//get screen height of the device by using
window.innerHeight
//get screen width of the device by using
window.innerWidth
Example 2: get screen width javascript
window.screen.width
//or just
screen.width
Example 3: width in % of a screen css
1vw = 1% of viewport width
1vh = 1% of viewport height