document.getElementById('myCard').clientHeight wrong value


#1

I was setting up clickable area for a ionic card to the full height of the card and I tried to get the height of the card like this:
document.getElementById(‘myCard’).clientHeight
However, when I tried to click on the card, I found out that around 20% of the bottom area of the card wasn’t clickable. That means, the above code didn’t return the correct height.

And all:
document.getElementById(‘myCard’).clientHeight
document.getElementById(‘myCard’).offsetHeight
document.getElementById(‘myCard’).scrollHeight

gave the same value as well.
Why?
Any help would be much appreciated.


#2

Hello,

maybe https://developer.mozilla.org/en-US/docs/Web/API/Element/clientHeight

Bewst regards, anna.liebt


#3

thanks for the help. I know what those terms means.