<
head
>
<
script
src
=
</
script
>
<
style
>
#div1 {
height: 100px;
width: 300px;
border: 2px solid black;
overflow: scroll;
}
h1 {
color: green;
}
</
style
>
</
head
>
<
body
>
<
center
>
<
h1
>GeeksforGeeks</
h1
>
<
h3
>Getting Content height</
h3
>
<
div
id
=
"div1"
>
Calculate content height of a div
on GeeksforGeek. GeeksforGeeks is
a computer science portal which
helps students to learn various
programming language and master
data structures and algorithms.
There are various courses available
to learn new skills.
</
div
>
<
br
>
<
button
onclick
=
"contentheight()"
>
Content height of Div
</
button
>
<
p
id
=
"p1"
></
p
>
</
center
>
<
script
>
function contentheight() {
var ans = "Content-height: "
+ angular.element(document
.getElementById("div1").clientHeight)
+ "px<
br
>";
document.getElementById("p1").innerHTML = ans;
}
</
script
>
</
body
>