YogeshChauhan . com

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

dreamhost

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 uninstall Cocoapods from the Mac OS? #4 How to add Read More Read Less Button using JavaScript? #5 How to Use SQL MAX() Function with Dates? #6 PHP Login System using PDO Part 1: Create User Registration Page

Recently Posted

May 5 Use inline if to make a shorter conditional syntax in React May 4 What is Conditional Rendering in React? May 3 How does @extend rule work in SCSS (Sass)? May 2 How different is Handling Events in React vs HTML DOM? May 2 How to create bouncing balls using HTML canvas and JavaScript? Apr 30 HTML canvas methods

You might also like these

How to Remove PHP File Extensions From Your Website URLs?PHPHow to get the first element with a class name xyz using JavaScript?JavaScriptStyling Lists with CSSCSSCommon Table Expressions (CTE) in PostgreSQLPostgresHow to get ACF values from custom post type?WordPressWhat are Conditional Tags in WordPress?WordPressHow to link/add CSS file to HTML Document?CSSHow does @extend rule work in SCSS (Sass)?SCSSWordPress: How to loop through a repeater field in ACF?WordPressWhat’s Closure in JavaScript?JavaScriptUPDATE and DELETE Statements in PostgresPostgresHow to create a Child Theme in WordPress?WordPress