Reputation: 133
I am creating textareas dynamically in jquery mobile. But the problem is dynamic textarea doesnt grow automatically on typing while the textarea created statically is autogrowing on typing.. can someone tell me how to implement autogrowing of dynamically created textareas. Thanks in advance
Upvotes: 0
Views: 497
Reputation: 13620
Try using this just after you add the textarea to the DOM:
$("#pageId").trigger('create');//id of the the data-role="page" div in which you are dynamically adding the texarea.
Upvotes: 1
Reputation: 14949
You can use the jQuery autogrow plugin for this.
$(function() {
$('#yourtextarea').autogrow();
});
Upvotes: 0