Skip to main content

Archive

Show more

How to get user screen size using javascript

how-to-get-user-screen-size-using-javascript


Question: How to get user screen size using javascript

Answer:

var height = window.screen.height;
var width = window.screen.width;

console.log(width);
console.log(height);

Output:

Your screen size may or may not match our output, depending on the screen size of your device.

1366 // width
768 // height


We try to provide you the best content, if there is any mistake in this article or there is any mistake in code, then let us know.

Comments