Screen width attribute
Definition and Usage
width attribute declares the browser screen display width, in pixels.
grammar
screen.width
Browser Support
All major browsers support width attribute
Examples
Examples
Returns the total width of your screen:
<script>
document.write("总宽度: " + screen.width);
</script>
document.write("总宽度: " + screen.width);
</script>
Examples of the above output:
try it"
More examples
This example contains all screen attributes
Screen objects