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