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
JavaScript String Properties and MethodsJavaScriptWhat is Hadoop and Hadoop Ecosystem?MiscellaneousWindow setTimeout() Method in JavaScriptJavaScriptDifferent Types of Functions in JavaScriptJavaScriptAn Introduction to wp-config file in WordPressWordPressHow does @extend rule work in SCSS (Sass)?SCSSHow to create a horizontal scrolling menu with and without flex using CSS (or SCSS)?CSSHow to hide a DIV on clicks outside of it using jQuery?jQueryHow to Check If a Variable is an Integer, a Float, a Number, NaN, an Infinite or a Numeric in PHP?PHPColleague UI Basics: The Search AreaColleagueHow to create a placeholder loader (throbber) using CSS?CSSIN and BETWEEN Operators in SQLSQL/MySQL