In the below code,
document.documentElement.clientWidth
1349
document.documentElement.clientHeight
363
window.innerWidth
1366
window.innerHeight
363
window.screen.height
768
window.screen.width
1366
So, My desktop screen is 1366 px wide and 768 px height.
I learnt that,
viewport dimensions are referred using document.documentElement.clientWidth and document.documentElement.clientHeight.
window dimensions are referred using window.innerWidth and window.innerHeight.
1) What is the difference between viewport and document?
2) when does window.onload Vs document.onload get invoked?