blogspot visit counter
Showing posts with label javascript-How to Get Screen Resolution of User or Client Machine. Show all posts
Showing posts with label javascript-How to Get Screen Resolution of User or Client Machine. Show all posts

Tuesday, 12 March 2013

How to Get Screen Resolution of User or Client Machine using java script

Introduction
Here I will explain how to Get Monitor screen resolution using JavaScript or Get screen resolution of user in JavaScript.
Description:
To get user screen resolution we need to write the code like as shown below
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Get Screen Resolution using JavaScript</title>
<script type="text/javascript" language="javascript">
function GetResolution(){
document.getElementById("txtWidth").value = screen.width;
document.getElementById("txtHight").value = screen.height;
}
</script>
</head>
<body onload="GetResolution();">
<table>
<tr><td align="center" colspan="2">
<b><span style="color: #990000;">Your Screen Resolution </span></b></td></tr>
<tr>
<td>Width :</td>
<td valign="middle"><input type="text" size="5" name="txtWidth" id="txtWidth">px</td>
</tr>
<tr>
<td>Height :</td>
<td valign="middle"><input type="text" size="5" name="txtHight" id="txtHight">px</td>
</tr>
</table>
</body>
</html>
Live Demo
For live demo check below of your screen resolution details
Your Screen Resolution
Width :px
Height :px
How to Get Screen Resolution of User or Client Machine
Related Posts Plugin for WordPress, Blogger...