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 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
Specificity of attribute selectorsCSSHere’s what we can do with PHP date() functionPHPHow to create a Child Theme in WordPress?WordPressHow to make a UILabel clickable in Swift 5?SwiftHow to use @each rule with key-value pair in SCSS?SCSSOptional arguments, Default parameters and REST parameters in JavaScriptJavaScriptNumber Properties in JavaScriptJavaScriptColleague UI Basics: Accessing the user interfaceColleagueWordPress: How to find all posts from a custom post type with multiple custom fields values?WordPressUse inline if to make a shorter conditional syntax in ReactReactWhat is iFrame in HTML? Why do we need it?HTMLStyling Lists with CSSCSS