js largura da tela 1

js largura da tela

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

console.log(altura);
console.log(largura);

Here is what the above code is Doing:
1. We’re creating a variable called altura and assigning it the value of the height of the screen.
2. We’re creating a variable called largura and assigning it the value of the width of the screen.
3. We’re printing the value of altura to the console.
4. We’re printing the value of largura to the console.

Similar Posts