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 How to check if radio button is checked or not using JavaScript? #2 Solution to “TypeError: ‘x’ is not iterable” in Angular 9 #3 How to add Read More Read Less Button using JavaScript? #4 How to uninstall Cocoapods from the Mac OS? #5 PHP Login System using PDO Part 1: Create User Registration Page #6 How to Use SQL MAX() Function with Dates?

Recently Posted

#Aug 15 Is PHP still good for back-end programming? #Aug 10 How to create a multisite network in WordPress? #Aug 3 How to create a circle that follows a cursor using JavaScript and CSS? #Aug 3 How to make a curtain slider using jQuery and CSS? #Aug 2 How to progressively load images and add a blurry placeholder? #Aug 1 How to create a placeholder loader (throbber) using CSS?
You might also like these
How to show confirmation alerts with OK and cancel buttons using Swift 5?SwiftHow to convert datetime to date format in JavaScript?JavaScriptSolution for “Yarn build: Failed because of a stylelint error”WordPressHow destructuring works in React?ReactDoes :is() pseudo selector hint at CSS preprocessing in the future?CSSFull and Partial CUBE in Postgres with ExamplesPostgresDefault Values in SCSS (Sass)SCSSHow to create a for loop in SCSS (Sass)?SCSSWhat is Hoisting in JavaScript?JavaScriptThe Difference Between isNaN() Method And isNaN() Function In JavaScriptJavaScriptHow to host Google fonts on your server and add them using CSS?CSSDifferent Types of Functions in JavaScriptJavaScript