I have a piece of code in Javascript to detect the resoultion of the screen.
Now the results for me(1920 x 1080) are standing inside a textbox (input) but I just want it without textbox. How do i need to do this?
Code:
<head>
<script type="text/javascript" language="javascript">
function scrResolution() {
var width = screen.width;
var height = screen.height;
document.getElementById("txt_scrWidth").value = width;
document.getElementById("txt_scrHeight").value = height;
}
</script>
</head>
<body onload="scrResolution();">
<table width="200" border="0">
<tr>
<td>
Width :
<input name="txt_scrWidth" type="text" id="txt_scrWidth" size="5" />
</td>
</tr>
<tr>
<td>
Height :
<input name="txt_scrHeight" type="text" id="txt_scrHeight" size="5" />
</td>
</tr>
</table>
</body>
</html>
1 Answer