Javascript examples for Browser Object Model:Screen
The availWidth property returns the width of the user's screen, in pixels, minus interface features like the Windows border.
A Number, representing the width of the user's screen, in pixels
The following code shows how to get the available width of your screen:
<!DOCTYPE html> <html> <body> <button onclick="myFunction()">Test</button> <p id="demo"></p> <script> function myFunction() {// www. j a va 2 s .co m var x = "Available Width: " + screen.availWidth + "px"; document.getElementById("demo").innerHTML = x; } </script> </body> </html>