I have a textarea with the the text Hello World. I would like to get the height of this text.
textarea
Hello World
I\'ve tried to use:
var eleme
In jQuery there is no scrollHeight, so it needs a little workaround. the solution would be:
var areaheight=$("textarea#element")[0].scrollHeight; $("#element").height(areaheight);
or shorter:
$("#element").height($("#element")[0].scrollHeight)