Maarduk
Maarduk

Reputation: 256

Dynamically generated textarea (JQuery) to fit inital content size

I'm trying to dynamically create, already filled, textarea using JQuery. I have a problem with making it's height to fit the content of given 'question'. Does someone have an idea how to solve it? I would be grateful.

questionHolder = document.createElement("textarea");
questionHolder.value = question;

Cheers!

Upvotes: 0

Views: 19

Answers (1)

DumbCoder7
DumbCoder7

Reputation: 252

Textarea has a rows attribute. Try searching for it.

question.setAttribute('rows','5')

Upvotes: 1

Related Questions