How to find the width of the screen using javascript

Manideepgoud
Posted by Manideepgoud under JavaScript category on | Points: 40 | Views : 249
To find the width of the screen we use screen.width .

<p id="fun"></p>
<script>
var a=document.getElementById("fun").innerHTML =
"Screen width is " + screen.width;
</script>


It displays the width of the screen in the output

Comments or Responses

Login to post response