textarea 自動適應高度

textarea 自動適應高度

 

<textarea name="mytextarea" cols="80" style="overflow-y:hidden;height:80px;" onpropertychange="this.style.height=this.scrollHeight+'px';" οninput="this.style.height=this.scrollHeight+'px';"></textarea>

 

 

#########################################################################################

$("textarea").each(function() {
    $(this).css("height",$(this).attr("scrollHeight"));
});

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章