<script>
document.all.控件ID.onpropertychange=function(){this.style.posHeight=this.scrollHeight};
</script>
放在网页代码的最下面就行了
TextBox一定要设置为多行模式
自动调整TextBox高度
本文介绍了一种使用JavaScript脚本自动调整网页中TextBox高度的方法,确保其能够根据输入内容自动扩展,适用于多行文本输入场景。
<script>
document.all.控件ID.onpropertychange=function(){this.style.posHeight=this.scrollHeight};
</script>
放在网页代码的最下面就行了
TextBox一定要设置为多行模式
4579

被折叠的 条评论
为什么被折叠?