Textarea control adaptive text height

		
        //自适应
        $('textarea').each(function () {
            this.setAttribute('style', 'height:' + (this.scrollHeight) + 'px;overflow-y:hidden;');
        }).on('input', function () {
            this.style.height = 'auto';
            this.style.height = (this.scrollHeight) + 'px';
        });

Reprinted from: https://blog.csdn.net/qq_35607510/article/details/74331305

Guess you like

Origin blog.csdn.net/FV8023/article/details/101033688