How To Get The Current Screen Size Using JavaScript ?

  Aug 2023
  Category: Solution

How To Get The Current Screen Size Using JavaScript ?

The current screen size can be obtained by following functions

window.innerWidth // get width
window.innerHeight // get height
<!DOCTYPE html>

<h2>Current Screen Size - ITSolutionsGuides</h2>
<p id="demo"></p>

var width = window.innerWidth;
var height = window.innerHeight;

var x = document.getElementById("demo");
x.innerHTML = "Window width: " + width + " ; height: " + height + ".";


We hope it helps everyone. Thanks for supporting ITSolutionsGuides and keep supporting us also follow us in social media platforms.

Subscribe for NewsLetter

Be the first to know about releases and tutorial news and solutions.

We care about your data in our privacy policy.


ITSolutionsGuides was started mainly to provide good and quality web solutions for all the developers. We provide tutorials to support all the developers and also we try to provide solutions to the errors we face while coding.

Contact US

ITSolutionsGuides, provide users with an easy-to-use form to reach out for support or inquiries.

whatsapp  gmail  instagram-new--v1  facebook-circled  twitter-circled  linkedin  github  pinterest 

Copyright © 2023 - 2024 All rights reserved | ITSolutionsGuides