getting screen resolutions javascript

The screen height defines the height of the screen and screen width property defines the height of screen resolutions. Example as :

<!DOCTYPE html>
<html>
<head>
<script>
function screenRes() 
{
	document.write("height " + screen.height + 
			" width " + screen.width);
}
</script>
<title>Getting screen resolution</title>
</head>
<body onload="screenRes();">

</body>
</html>