I have a textarea
with the the text Hello World
. I would like to get the height of this text.
I've tried to use:
var element = document.getElementById('textarea');
var textHeight = element.innerHTML.offsetHeight;
and:
var textHeight = element.value.offsetHeight;
But these don't give the numbers of the text, but the height of the textarea
element.
<span>
inside the<textarea>
, right? – Tomchay