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

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
Introduction to components and templates Part 4: Pipes and DirectivesAngularHow to get current timestamp in Swift 4 and 5?SwiftWhat is IPS(Intrusion Prevention System), How Does It Work and What are the Detection Types?MiscellaneousHow to progressively load images and add a blurry placeholder?CSSHow get_template_part helps write reusable code in WordPress?WordPressHow does @extend rule work in SCSS (Sass)?SCSSHow to set the permissions on all files and folders in Mac?MiscellaneousWhat are Big Data Clusters in SQL Server?SQL/MySQLWhen you don’t want to @forward every member in SCSS (Sass)SCSSrandom function in SCSS (Sass)SCSS@use rule in SCSS (Sass)SCSSFunction Scope in JavaScript for BeginnersJavaScript