My Computer Tips was launched in 2015 and provides information for common tasks in various Linux distributions and other computer related subjects.
My Computer tips has over 290 tutorials and tips.
If you found the information on My Computer Tips useful, please consider sharing our site details.
ID: 330
Category: Vanilla Javascript
Added: 21st of December 2022
Views: 1,781
The script below displays the window width and window height dimensions.
When the window is resized the window dimensions are reloaded using the window.addEventListener resize function.
We assign window.innerWidth and window.innerHeight properties to variables and then use the document.write to print the dimensions on the screen.
Create a new file on your Desktop named windowDimensions.html, copy and paste the code below then save the file. Launch the file in your browser.
Linux Forums
Linux Gaming
Other Linux / Computer Sites
Other Sites / Shopping