Categories
JavaScript Answers

How to get browser height with JavaScript?

Spread the love

Sometimes, we want to get browser height with JavaScript.

In this article, we’ll look at how to get browser height with JavaScript.

How to get browser height with JavaScript?

To get browser height with JavaScript, we use the window.innerHeight property.

For instance, we write

const browserHeight = window.innerHeight;

to get the height of the browser tab with the window.innerHeight property.

Conclusion

To get browser height with JavaScript, we use the window.innerHeight property.

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *