2019. 12. 26. 09:02

[Jquery] Textarea 높이 자동

$("textarea").each(function() {
var offset = this.offsetHeight - this.clientHeight;
var resizeTextarea = function(el) {
$(el).css('height', 'auto').css('height', el.scrollHeight + offset);
};
$(this).on('keyup input focusin', function() { resizeTextarea(this); });
});