我有一段 Javascript 代码来检测屏幕的分辨率。现在我的结果(1920 x 1080)位于文本框(输入)内,但我只想要没有文本框。我需要怎么做?
代码:
<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>