Yogesh Chauhan's Blog

Window innerHeight and innerWidth properties in JavaScript

in JavaScript on April 29, 2021

Window interface is a window that contains an HTML DOM.

The HTML doc is loaded in a window hence, it becomes the window interface.

innerHeight property

Since, innerHeight property is associated with the window interface, it returns the inner height of the window.

The return value is in pixels and a read-only. If a horizontal scrollbar is present then it includes it’s height in the return value.

innerHeight property Example

innerWidth property

Since, innerWidth property is associated with the window interface, it returns the inner width of the window.

The return value is in pixels and a read-only. If a vertical scrollbar is present then it includes it’s height in the return value.

innerWidth property Example


Most Read

#1 Solution to the error “Visual Studio Code can’t be opened because Apple cannot check it for malicious software” #2 How to add Read More Read Less Button using JavaScript? #3 How to check if radio button is checked or not using JavaScript? #4 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to uninstall Cocoapods from the Mac OS?

Recently Posted

#Apr 8 JSON.stringify() in JavaScript #Apr 7 Middleware in NextJS #Jan 17 4 advanced ways to search Colleague #Jan 16 Colleague UI Basics: The Search Area #Jan 16 Colleague UI Basics: The Context Area #Jan 16 Colleague UI Basics: Accessing the user interface
You might also like these
Recursive WITH Queries in Postgres (Common Table Expressions)PostgresStyling Lists with CSSCSSthe box-sizing property in CSSCSSHow to apply style only to first child and/or only to children other than the first child?CSSWhat’s a Web Storage API in JavaScript?JavaScriptHow to add a select dropdown in React?ReactDid you get an error while displaying Special Characters in JavaScript?JavaScriptWordPress: How to create a folder if it doesn’t already exist?WordPressValues and Types Basics in JavaScriptJavaScriptVariables scope and shadowing in SCSS (Sass)SCSSList of WordPress directories functionsWordPressDebugging in WordPress Part 1: WP_DEBUGWordPress