Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
August 30, 2021 04:15 pm GMT

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 consoleconsole.log(width+"x"+height); // my output: 1366x768</script>

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.

Read: Can we store php variable in javascript?

Social Profile : LinkedIn

Have a Nice Day!


Original Link: https://dev.to/pavankumarsadhu/how-to-check-resolution-of-laptop-computer-using-javascript-11ol

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To