---
title: "get height and width of screen"  
description: "get height and width of screen"  
author: "nithersh ankugan"  
published: 2013-02-12  
updated: 2013-02-12  
canonical: https://www.mindstick.com/forum/588/get-height-and-width-of-screen  
category: "javascript"  
tags: ["javascript"]  
reading_time: 1 minute  

---

# get height and width of screen

Hi Everyone!

I want to set div [width and height](https://www.mindstick.com/forum/158680/what-css-property-is-used-to-set-the-width-and-height-of-an-element) according [screen resolution](https://answers.mindstick.com/qa/102458/explain-the-significance-of-a-laptop-s-screen-resolution) in html. How to get [screen width](https://www.mindstick.com/forum/158674/how-can-you-make-an-image-adjust-its-size-based-on-the-screen-width) and height using JavaScript.

Thanks in [advance](https://www.mindstick.com/blog/33258/jee-mains-and-jee-advance-exams)

## Replies

### Reply by AVADHESH PATEL

Hi Nithersh!\
Used JavaScript for getting width and height of [screen](https://www.mindstick.com/forum/33644/loading-screen-during-ajax-call) [resolution](https://www.mindstick.com/articles/12502/looking-for-an-mba-degree-we-guide-you-with-the-perfect-resolution). \

```
 <script>  	document.write("Total Width: " + screen.width);  	document.write("Screen Height: " + screen.height); </script>
```


---

Original Source: https://www.mindstick.com/forum/588/get-height-and-width-of-screen

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
