Screen Resolution Alert

Technical diagnostics made easy. This script accesses the screen object in JavaScript to report the user's current display resolution settings.

Copy the Script

<script>
function checkResolution() {
    var w = screen.width;
    var h = screen.height;
    alert("Your screen resolution is: " + w + " x " + h);
}
</script>

<button onclick="checkResolution()">Check Resolution</button>

Frequently Asked Questions

The 'screen.width' property measures the entire physical monitor. To measure just the available space inside the browser window, you should use 'window.innerWidth' instead.

Yes. It works on mobile devices to detect viewport size, though modern CSS Media Queries are the preferred way to handle responsive design.

Yes. You could send these variables to a PHP script via AJAX or a cookie to log visitor statistics.