The innerWidth
property in JavaScript returns the width, and the innerHeight property returns the height of the window content area.
Syntax:
window.innerWidth window.innerHeight
Parameters: It does not require any parameters.
Return value: Returns a number indicating the width and height of the window content area.
Note: For IE 8 ie (Internet Edg 8) or earlier, use clientWidth and clientHeight to get the width and height of the window.
Example:
Output:
##Related recommendations: "javascript tutorial"
This article is an introduction to the Window innerWidth and innerHeight properties in JavaScript. I hope it will be helpful to friends in need!The above is the detailed content of Detailed explanation of innerWidth and innerHeight properties in JavaScript. For more information, please follow other related articles on the PHP Chinese website!