JavaScript screen resolution

Is a dynamic computer programming language.[5] It is most commonly used as part of web browsers, whose implementations allow client-side scripts to interact with the user, control the browser, communicate asynchronously, and alter the document content that is displayed.[5] It is also used in server-side network programming with runtime environments such as Node.js, game development and the creation of desktop and mobile applications.
Post Reply
dzcadii
Posts: 94
Joined: Sun Mar 01, 2015 4:36 am

JavaScript screen resolution

Post by dzcadii » Sun Mar 01, 2015 10:58 pm

Find the screen resolution with JavaScript

Code: Select all

<script language="JavaScript">
function resolution(){
var wid = screen.width;
var hei = screen.height;

alert('Your screen resolution is '+wid+'x'+hei);
}

</script>
<a href="javascript:resolution();">Click here to action the function to find your resolution</a>
or

Code: Select all

<a href="javascript:alert('Your resolution is '+screen.width+'x'+screen.height);">Click to see your resolution</a>

Post Reply