首页 > 技术文章 > textarea自动适应高度

dreamboy 2019-10-17 15:51 原文

textarea自动适应高度,兼容IE/Firefox、chrome

代码:
<textarea name="textarea" id="textarea" style='overflow-y: hidden;height:20px' onpropertychange="this.style.height = this.scrollHeight + 'px';" oninput="this.style.height = this.scrollHeight + 'px';">
</textarea>

推荐阅读