DEV Community

Cover image for How to check resolution of laptop/computer using JavaScript?
pavankumarsadhu
pavankumarsadhu

Posted on • Edited on

3 1

How to check resolution of laptop/computer using JavaScript?

Hi guys,

Today we will see how to check resolution of laptop/computer using JavaScript.

To check screen width and height, we have default functions in JavaScript.

They are:

1.screen.width - to check the screen width

2.screen.height - to check the screen height

<script>
var width = screen.width;
var height = screen.height;
//prints output in console
console.log(width+"x"+height); // my output: 1366x768
</script>
Enter fullscreen mode Exit fullscreen mode

Read: How to Increase upload limit upto 1000GB in Wordpress using Increase Upload Limit Plugin for LIFETIME Free of Cost?

In this way, we can check the user laptop/computer resolution.

Thanks for taking your valuable time for reading my post, if you have any queries , please leave a comment and will respond. If you find this post useful, please share it.

Social Profile : LinkedIn

Have a Nice Day!

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (0)

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

Rather than just generating snippets, our agents understand your entire project context, can make decisions, use tools, and carry out tasks autonomously.

Read full post

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay