textarea set height based on content js or jquery
===

this is my code: (keep it simple)    `<textarea style="height:100px;"> $textareatext </textarea>`
if $textareatext is 1 line long I want the height of textarea to fit
if its 3, 5 or 10 lines...same thing.
the issue I am having is at 100px the height is too big,but if I set it to 20px and there are 10lines then the textarea height is too small.
any suggestions? I use javascript and jquery, or anything you would suggest thank you