JavaScript Window innerWidth and innerHeight Properties Last Updated : 12 Mar, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report The innerWidth property in JavaScript returns the width and innerHeight property returns the height of window content area. Syntax: window.innerWidthwindow.innerHeightParameter: It doesn't require any parameters. Return Value: It returns a number(Representing the Width and Height of the window's content area). Note: For IE 8 i.e (Internet Edge 8) or earlier, use clientWidth and clientHeight to get the width and height of the window. Example: In this example we retrieve and display the inner width and height of the browser window using JavaScript, showing the dimensions dynamically in a paragraph element. html <!DOCTYPE html> <html> <head> <title>Browser Window</title> </head> <body> <h2>Browser Window</h2> <p id="demo"></p> <script> var Width, Height, result; Width = window.innerWidth || document.documentElement .clientWidth || document.body.clientWidth; Height = window.innerHeight || document.documentElement .clientHeight || document.body.clientHeight; result = document.getElementById("demo"); result.innerHTML = "Browser inner width: " + Width + "<br>Browser inner height: " + Height; </script> </body> </html> Output: Window innerWidth and innerHeight Properties Example Output Comment More infoAdvertise with us Next Article How to calculate Width and Height of the Window using JavaScript ? N Naman_Garg Follow Improve Article Tags : JavaScript Web Technologies JavaScript-Properties Similar Reads HTML DOM Window innerWidth Property The Window innerWidth property is used for returning the width of a window's content area. It is a read-only property and returns a number which represents the width of the browser window's content area in pixels.Syntaxwindow.innerWidthReturn Value: It returns a number that represents the browser wi 1 min read HTML DOM Window innerHeight Property The Window innerHeight property is used for returning the height of a window's content area. It is a read-only property and returns a number which represents the height of the browser window's content area in pixels. Syntax: window.innerHeightReturn Value: It returns a number that represents browser 1 min read How to calculate Width and Height of the Window using JavaScript ? In this article, we will know to calculate the width & the height of the window using Javascript. Given an HTML document that is running on a Window & we need to find the height and width of the window. The Window innerWidth property is used for returning the width of a windowâs content area 2 min read How to calculate Width and Height of the Window using JavaScript ? In this article, we will know to calculate the width & the height of the window using Javascript. Given an HTML document that is running on a Window & we need to find the height and width of the window. The Window innerWidth property is used for returning the width of a windowâs content area 2 min read HTML DOM Window outerWidth Property The window outerWidth property is used for returning the outer width of the browser window. It includes all the interface elements such as toolbars, scrollbars, etc. It is a read-only property and returns a number which represents the width of the browserâs window in pixels. Syntaxwindow.outerWidthR 1 min read How to get the Width and Height of an Image using JavaScript? Given an image and the task is to get the width and height of the image using JavaScript. The width and height property is used to display the image width and height. Syntax for width:let width = this.width;Syntax for height:let height = this.height;Example 1: This example selects the image and then 2 min read Like