[JS]Textarea 自动调整高度 (适用于各浏览器)

<textarea onpropertychange="setHeight(this);" onmouseover="setHeight(this);"
onpaste="setHeight(this);" oninput="setHeight(this);">
</textarea>

1    function setHeight(obj)
2    {
3         obj.style.height = obj.scrollHeight + 'px';
4    }

 



 

posted @ 2013-10-30 10:08  Mr heekey  阅读(446)  评论(1)    收藏  举报