<!DOCTYPE html>
<
html
>
<
head
>
<
title
>
Returning the Screen height
and width Property in HTML
</
title
>
<
style
>
h1 {
color: green;
}
h2 {
font-family: Impact;
}
body {
text-align: center;
}
</
style
>
</
head
>
<
body
>
<
h1
>GeeksforGeeks</
h1
>
<
h2
>
Returning the Screen height and
width Property in HTML
</
h2
>
<
p
>
For checking the screen's total height,
double click the "Check Height" button:
</
p
>
<
br
>
<
p
>
For checking the screen's total width,
double click the "Check width" button:
</
p
>
<
button
ondblclick
=
"check_height()"
>
Check Height
</
button
>
<
button
ondblclick
=
"check_width()"
>
Check width
</
button
>
<
p
id
=
"height"
></
p
>
<
script
>
function check_height() {
var h = "Total Screen Height In Pixels : "
+ screen.height;
document.getElementById("height").innerHTML = h;
}
function check_width() {
var w = "Total Screen width In Pixels : "
+ screen.width;
document.getElementById("height").innerHTML = w;
}
</
script
>
</
body
>
</
html
>